-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat: respect x-* headers for redirections #9054
Conversation
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.
Interesting to have ProxyFix middleware.
It's suggested to add this feature as an optional one with a switch config, instead of enforcing overwriting by default. It could be natively semantic to distinguish the original headers for most cases, especially for the detailed trouble shooting.
@bowenliang123 |
@bowenliang123 |
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.
LGTM overall. Some comments to follow.
And the prefix of this PR should be feat:
.
cc @laipz8200
@bowenliang123 @laipz8200 |
Updated the branch to follow the changes on #9089 |
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.
LGTM.
Checklist:
Important
Please review the checklist below before submitting your pull request.
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint godsDescription
To adjusts WSGI to respect X-* headers of redirected HTTP requests, apply Proxy Fix middlewares. Refer to: https://werkzeug.palletsprojects.com/en/3.0.x/middleware/proxy_fix/
Fixes #9052
Type of Change
Testing Instructions
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Deploy API with this PR with HTTPS enabled configuration, then send HTTP request to
curl -vL https://<FQCN>/v1
(HTTPS endpoint)Deploy API with this PR with HTTPS disabled configuration, then send HTTP request to
curl -vL http://<FQCN>/v1
(HTTP endpoint)