Dynamic Access-Control-Expose-Headers Support#27
Open
yinheli wants to merge 1 commit intofruitcake:masterfrom
Open
Dynamic Access-Control-Expose-Headers Support#27yinheli wants to merge 1 commit intofruitcake:masterfrom
yinheli wants to merge 1 commit intofruitcake:masterfrom
Conversation
f3ef5d4 to
43c705a
Compare
Member
|
What would be the use-case of adding these headers in the controller or middleware? |
Author
|
Here are some common use cases for dynamically adding Access-Control-Expose-Headers in controllers or middleware:
This dynamic approach allows applications to:
The proposed implementation provides this flexibility while maintaining backwards compatibility with global configuration. Imagine that if you are maintaining a large monolithic application, you wouldn't want the CORS middleware configuration to affect many routes. |
a3b7e15 to
7c97da7
Compare
- Update CorsService to merge existing exposed headers with configured - Add deduplication for exposed headers fruitcake#29
7c97da7 to
f4f4b4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Benefits
Testing
I've added new unit tests to cover.
Feedback and suggestions are welcome. Thank you!