-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] add support for X_FORWARDED_PREFIX header #37734
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
btw, A new |
Agree! I added the required midifications. |
|
Hi @stof, do you have any idea, why the integration tests are failing? The error does not seem to be related to my changes. |
Do you have any special condition in mind that we should take care of? I checked the code, and actually |
hmm, I forgot that |
Yep, ok. The assertion in tests is already done. |
Hi @stof as far as I see all issues are now resolved, right? Are there any todos to get this merged? |
aea776d
to
109e0a9
Compare
Thank you @jeff1985. |
@@ -1,6 +1,11 @@ | |||
CHANGELOG | |||
========= | |||
|
|||
5.3.0 |
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.
Isn't it rather 5.2?
…in config (drupol) This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead. Discussion ---------- [FrameworkBundle] Allow x-forwarded-prefix trusted header in config | Q | A | ------------- | --- | Branch? | 5.2 (as requested by @nicolas-grekas) | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Support for `X_FORWARDED_PREFIX` has been added in PR #37734. However, it is impossible to use it because the configuration doesn't allow the `x-forwarded-prefix` value in `framework.yaml`. Commits ------- 95fdd90 Allow x-forwarded-prefix trusted header.
…' (JohJohan) This PR was submitted for the 5.2 branch but it was merged into the 5.3 branch instead. Discussion ---------- [HttpFoundation] 14114 header option 'X-Forwarded-Prefix' Fixes #14114. Should i also document something about using it with traefik? `@jeff1985` you might be able to anwser that as you added the code with symfony/symfony#37734 Could a label `hacktoberfest-accepted` be added to this pull request? I am participating https://hacktoberfest.digitalocean.com/details Commits ------- c670141 14114 [HttpFoundation] header option 'X-Forwarded-Prefix'
Refs: - symfony/symfony#37734 - symfony/symfony#38954 This upgrade causes a breaking change since newly generated config files created from v1.1.4 to v1.1.8 include a default reference to `Illuminate\Http\Request::HTTP_X_FORWARDED_ALL` which no longer exists as of Laravel 9 / Symfony 6 and there is no way for us to replace that class to add it back ourselves without copying the entirety of the class into our project and class_alias()ing it, which would be a bad idea for lots of reasons.
Add support for
X-Forwarded-Prefix
header added by the popular Traefik HTTP LoadBalancer and Reverse Proxy. This ensures that the links rendered by symfony application deployed behind LB are valid even if the application is deployed via prefix URL.Example routing setup:
route
/admin/(.*)
=> symfony backend/$1
in this case links rendered by symfony backend must start with
/admin/
To accept traefik prefix in your symfony app, you must modify index.php to allow accepting this header: