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

UriComponentsBuilder's fromHttpRequest uses server port as host port when handling the Forwarded header [SPR-15504] #20063

spring-projects-issues opened this issue May 2, 2017 · 0 comments
in: web type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented May 2, 2017

Gregory Vandenbroucke opened SPR-15504 and commented

The UriComponentsBuilder's adaptFromForwardedHeaders method doesn't handle the host port of the Forwarded header correctly, which means that the URI generated through the fromHttpRequest method will append the server port to the host (of the Forwarded header), instead of just using the port (if any) defined in the host part of the Forwarded header.
According to the RFC and the host part of the Forwarded header "provides the host and port information from the target URI", and as such should be handled in the adaptFromForwardedHeaders method.

The pull request 1413 will try to parse the port of the host of the Forwarded header, and configure the builder accordingly.

related pull request: #1413

Issue Links:

  • #20809 spring-web CORS requires X-Forwarded-Port

Referenced from: pull request #1413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: enhancement
None yet

No branches or pull requests

2 participants