Skip to content

Commit

Permalink
Add test case for multivalue x-forwarded host header
Browse files Browse the repository at this point in the history
Issue: SPR-11140
  • Loading branch information
rstoyanchev committed Dec 3, 2013
1 parent d424561 commit 7713a55
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ public void fromRequestWithForwardedHostAndPortHeader() {
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");
Expand Down

0 comments on commit 7713a55

Please sign in to comment.