-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prioritize headers set by the Response
class
#9235
Merged
Merged
Conversation
This file contains 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
michalsn
added
bug
Verified issues on the current code behavior or pull requests that will fix them
breaking change
Pull requests that may break existing functionalities
4.6
labels
Oct 25, 2024
neznaika0
approved these changes
Nov 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. You've relieved the pain. I fixed this session_cache_limiter(");
in app/Common.php
samsonasik
approved these changes
Dec 22, 2024
paulbalandan
approved these changes
Dec 23, 2024
michalsn
force-pushed
the
fix/headers
branch
from
December 24, 2024 11:03
63a6fc7
to
dd7c025
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor grammar fix
Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com>
paulbalandan
approved these changes
Dec 27, 2024
Thanks everyone! |
Yes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
4.6
breaking change
Pull requests that may break existing functionalities
bug
Verified issues on the current code behavior or pull requests that will fix them
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.
Description
This PR changes the way headers are set. Now headers set by the
Response
class will be prioritized and will replace those set by calling theheader()
function.Why is this important? Without this change, we cannot override the headers set previously with the
header()
function.This is relevant, especially when we work with a session. By default,
session.cache_limiter
is set tonocache
, which is fine for the default setting and will automatically set headers:But we have no option to change these headers, even when we set different
Cache-Control
etc with theResponse
class. If we do so, we end up with two entries forCache-Control
, which will possibly lead to unexpected behavior. We also cannot remove the default headers set bysession.cache_limiter
, because they are set with theheader()
function directly.Headers set with the
Response
class should be prioritized. This is potentially a BC break, but also a bugfix.Ref: #9234
Checklist: