-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For #18688
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4c262d4
Emit a warning when a request has both a trusted
magnusnordlander da4b6c5
Updated according to fabbot review
magnusnordlander f0c3d15
Changed warning to exception, and only throws when headers disagree.
magnusnordlander 2eea0f1
CS fix
magnusnordlander c017290
Added a listener to validate requests
magnusnordlander 99b072e
Changed listener to only throw on master requests (to preserve except…
magnusnordlander 41d2603
Added fabbot CS fixes
magnusnordlander ea691e7
Made the profiler handle unknown client IPs.
magnusnordlander a9f864d
Updated tests
magnusnordlander 66f19f1
Renamed listener and CS fixes.
magnusnordlander d52d098
Fixed test failures
magnusnordlander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updated according to fabbot review
- Loading branch information
commit da4b6c5fc610c66b3a2e58f7eb9499562245a6ae
There are no files selected for viewing
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
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.
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.
I'm wondering if we could instead throw an exception here. What do you think? Any use case where setting both would be legitimate?
Uh oh!
There was an error while loading. Please reload this page.
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.
It could be legitimate as a legacy measure from proxies, if both headers contain the same information, I suppose.
That can be detected of course, I mean, it's just a matter of parsing both headers and see if they have the same IPs.
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.
I'll update this PR to do that, because we probably don't want neither to warn nor throw exceptions if a proxy sends both headers for backwards compatibility.