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

ServletUriComponentsBuilder doesn't work if X-Forwarded-Host is in host:port format [SPR-10701] #15329

spring-issuemaster opened this issue Jun 27, 2013 · 0 comments


None yet
2 participants
Copy link

commented Jun 27, 2013

Hrvoje Jambrovic opened SPR-10701 and commented

Linked with #14743
ServletUriComponentsBuilder takes X-Forwarded-Host value from header (if exists) and puts it as "host".
If X-Forwarded-Host is:

creating uri produces error:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Could not create URI object: Malformed IPv6 address at index 8: http://[]:8180/api/person/449089
at org.springframework.web.servlet.FrameworkServlet.processRequest(

Definition of Host header:

X-Forwarded-Host is a copy of Host header:

Affects: 3.2.1

Issue Links:

  • #15346 X-Forwarded-Host handling in ServletUriComponentsBuilder does not treat ports correctly ("is duplicated by")
  • #17410 X-Forwarded-Port with Comma Separated List Not Able to be Parsed in Spring 4.1.x

Referenced from: commits 1e90d02, 6c11fd3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.