Skip to content

IPv6 + Origin header + X-Forwarded-Host header gives NumberFormatException (Safari10 / CORS) [SPR-14761] #19327

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jaap opened SPR-14761 and commented

When an IPv6-only client connects to our WebApp which uses Spring 4.3.2

And the browser sends an Origin header (Safari 10 does this under certain circumstances)

And the LoadBalancer/Reverse Proxy adds an X-Forwarded-Host header (with the IPv6 address)

Then you get a java.lang.NumberFormatException: For input string: "a51:0:920::30:20"
at org.springframework.web.util.UriComponentsBuilder.adaptFromForwardedHeaders(UriComponentsBuilder.java:691)

It appears that this CORS code is IPv4 only?


Referenced from: commits 3064527, ea5ff87, 8751c99

Backported to: 4.2.9

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions