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

Handling of "X-Forwarded-Host" to support "host:port" #2711

Closed
rstoyanchev opened this issue Mar 1, 2023 · 0 comments · Fixed by #2712
Closed

Handling of "X-Forwarded-Host" to support "host:port" #2711

rstoyanchev opened this issue Mar 1, 2023 · 0 comments · Fixed by #2712
Assignees
Labels
type/enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Mar 1, 2023

After Spring Framework switched to using HttpServerRequest#hostAddress first instead of parsing the "Host" header in spring-projects/spring-framework#28601 in order to ensure forwarded headers take effect.

However, as reported in spring-projects/spring-boot#34395 and discussed under spring-projects/spring-framework#30033, if "X-Forwarded-Host" has host and port, e.g. "localhost:3000" then HttpServerRequest#hostAddress returns a hostString with the port in it. It would be useful to parse that since it can happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants