php-cors icon indicating copy to clipboard operation
php-cors copied to clipboard

Dynamic Access-Control-Expose-Headers Support

Open yinheli opened this issue 1 year ago • 2 comments

Add Dynamic Support for Access-Control-Expose-Headers

This PR implements dynamic support for the Access-Control-Expose-Headers header in php-cors, addressing the need for more flexible CORS header management in complex applications.

Proposal issue: #29

Changes

  • Update CorsService to merge existing exposed headers with configured
  • Add deduplication for exposed headers

Benefits

  • Allows developers to set exposed headers dynamically at the controller or middleware level.
  • Provides greater flexibility for applications with diverse API endpoints requiring different header exposures.
  • Maintains backwards compatibility with existing global configuration.

Testing

I've added new unit tests to cover.

Feedback and suggestions are welcome. Thank you!

yinheli avatar Sep 04 '24 01:09 yinheli