Skip to content
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

Sanitize X-Forwarded-Proto header in RedirectScheme middleware #9598

Merged
merged 3 commits into from Dec 16, 2022

Conversation

ldez
Copy link
Member

@ldez ldez commented Dec 9, 2022

What does this PR do?

Sanitize X-Forwarded-Proto header in RedirectScheme middleware

Motivation

Fixes #9597

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

Co-authored-by: Julien Salleyron julien.salleyron@gmail.com

@ldez ldez added this to To review in v2 via automation Dec 9, 2022
@traefiker traefiker added this to the 2.9 milestone Dec 9, 2022
Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sylr
Copy link
Contributor

sylr commented Dec 9, 2022

There is a typo in the commit message title is -> in.

@ldez ldez changed the title fix: sanitize X-Forwarded-Proto header is RedirectScheme middleware fix: sanitize X-Forwarded-Proto header in RedirectScheme middleware Dec 9, 2022
@Thor77
Copy link

Thor77 commented Dec 12, 2022

Is it intended that this would also cause a redirect for an invalid X-Forwarded-Proto header (like a combination of two of them, https, https, which some software creates)?

@ldez
Copy link
Member Author

ldez commented Dec 12, 2022

Yes, it's intended because by convention this header is mono-valued.
Even inside the RFC7239 about Forwarded it's a mono-valued field.

@ldez ldez force-pushed the fix/redirect-xForwardedProto branch from d858115 to 6633b12 Compare December 15, 2022 14:53
Copy link
Member

@rtribotte rtribotte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@traefiker traefiker merged commit 29b8b69 into traefik:v2.9 Dec 16, 2022
v2 automation moved this from To review to Done Dec 16, 2022
@ldez ldez deleted the fix/redirect-xForwardedProto branch December 16, 2022 09:34
@rtribotte rtribotte changed the title fix: sanitize X-Forwarded-Proto header in RedirectScheme middleware Sanitize X-Forwarded-Proto header in RedirectScheme middleware Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants