Closed
Description
Chris Pimlott opened SPR-11140 and commented
The support for the X-Forwarded-Host
header added in #14743 does not account for having multiple comma-separated hosts in the header, e.g.:
X-Forwarded-Host: foo.com, bar.com, baz.com
Test case:
@Test
public void testMultiValuedXForwardedHostHeader() {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader("X-Forwarded-Host", "a.example.org, b.example.org, c.example.org");
assertEquals("a.example.org", ServletUriComponentsBuilder.fromRequest(request).build().getHost());
}
Affects: 3.2.5