Add test case for multivalue x-forwarded host header

Issue: SPR-11140
This commit is contained in:
Rossen Stoyanchev
2013-12-03 09:24:40 -05:00
parent d4245610a2
commit 7713a55f6b

View File

@@ -107,6 +107,15 @@ public class ServletUriComponentsBuilderTests {
assertEquals(443, result.getPort());
}
// SPR-11140
@Test
public void fromRequestWithForwardedHostMultiValuedHeader() {
this.request.addHeader("X-Forwarded-Host", "a.example.org, b.example.org, c.example.org");
assertEquals("a.example.org", ServletUriComponentsBuilder.fromRequest(this.request).build().getHost());
}
@Test
public void fromContextPath() {
request.setRequestURI("/mvc-showcase/data/param");