php-cors
php-cors copied to clipboard
Dynamic Access-Control-Expose-Headers Support
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!