-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] fix false-positive ConflictingHeadersException #28144
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
Conversation
97d90e8
to
6089290
Compare
// Remove port (unfortunately, it does happen) | ||
if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { | ||
$clientIps[$key] = $clientIp = $match[1]; | ||
if (strpos($clientIp, '.')) { |
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.
this part of the patch is a bugfix backported from 4.1, needed by the fix line 1946 (brackets should not be removed from the value)
@@ -967,7 +967,7 @@ public function testGetClientIpsWithAgreeingHeaders($httpForwarded, $httpXForwar | |||
'HTTP_X_FORWARDED_FOR' => $httpXForwardedFor, | |||
); | |||
|
|||
Request::setTrustedProxies(array('88.88.88.88')); | |||
Request::setTrustedProxies(array('88.88.88.88'), -1); |
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.
wrongly set to Request::HEADER_X_FORWARDED_ALL
on 3.4+, this will act as a reminder by the conflict it will create when merging
I can confirm that this PR fixed https://jira.ez.no/browse/EZP-29497 on my local installation. |
…ption (nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [HttpFoundation] fix false-positive ConflictingHeadersException | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28153 | License | MIT | Doc PR | - Fixes https://jira.ez.no/browse/EZP-29492 & https://jira.ez.no/browse/EZP-29497 Ping @andrerom Commits ------- 6089290 [HttpFoundation] fix false-positive ConflictingHeadersException
@fabpot @nicolas-grekas Can we get |
* 3.4: [HttpKernel] fix trusted headers management in HttpCache and InlineFragmentRenderer
Fixes https://jira.ez.no/browse/EZP-29492 & https://jira.ez.no/browse/EZP-29497
Ping @andrerom