Issue #3302 Supporting host:ip in X-Forwarded-For (fixing unit tests)

Signed-off-by: alexey.barsov <alexey.barsov@jetbrains.com>
This commit is contained in:
alexey.barsov 2019-02-01 15:48:58 +01:00
parent 803a45b43b
commit 25afa868da
1 changed files with 4 additions and 4 deletions

View File

@ -224,14 +224,14 @@ public class ForwardedRequestCustomizerTest
String response=_connector.getResponse(
"GET / HTTP/1.1\n"+
"Host: myhost\n"+
"X-Forwarded-For: 10.9.8.7:1111,6.5.4.3:1111\n"+
"X-Forwarded-For: 10.9.8.7:1111,6.5.4.3:2222\n"+
"\n");
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("http",_results.poll());
assertEquals("myhost",_results.poll());
assertEquals("80",_results.poll());
assertEquals("10.9.8.7",_results.poll());
assertEquals("0",_results.poll());
assertEquals("1111",_results.poll());
}
@Test
@ -240,14 +240,14 @@ public class ForwardedRequestCustomizerTest
String response=_connector.getResponse(
"GET / HTTP/1.1\n"+
"Host: myhost\n"+
"X-Forwarded-For: [2001:db8:cafe::17]:1111,6.5.4.3:1111\n"+
"X-Forwarded-For: [2001:db8:cafe::17]:1111,6.5.4.3:2222\n"+
"\n");
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("http",_results.poll());
assertEquals("myhost",_results.poll());
assertEquals("80",_results.poll());
assertEquals("[2001:db8:cafe::17]",_results.poll());
assertEquals("0",_results.poll());
assertEquals("1111",_results.poll());
}
@Test