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:
parent
803a45b43b
commit
25afa868da
|
@ -224,14 +224,14 @@ public class ForwardedRequestCustomizerTest
|
||||||
String response=_connector.getResponse(
|
String response=_connector.getResponse(
|
||||||
"GET / HTTP/1.1\n"+
|
"GET / HTTP/1.1\n"+
|
||||||
"Host: myhost\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");
|
"\n");
|
||||||
assertThat(response, Matchers.containsString("200 OK"));
|
assertThat(response, Matchers.containsString("200 OK"));
|
||||||
assertEquals("http",_results.poll());
|
assertEquals("http",_results.poll());
|
||||||
assertEquals("myhost",_results.poll());
|
assertEquals("myhost",_results.poll());
|
||||||
assertEquals("80",_results.poll());
|
assertEquals("80",_results.poll());
|
||||||
assertEquals("10.9.8.7",_results.poll());
|
assertEquals("10.9.8.7",_results.poll());
|
||||||
assertEquals("0",_results.poll());
|
assertEquals("1111",_results.poll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -240,14 +240,14 @@ public class ForwardedRequestCustomizerTest
|
||||||
String response=_connector.getResponse(
|
String response=_connector.getResponse(
|
||||||
"GET / HTTP/1.1\n"+
|
"GET / HTTP/1.1\n"+
|
||||||
"Host: myhost\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");
|
"\n");
|
||||||
assertThat(response, Matchers.containsString("200 OK"));
|
assertThat(response, Matchers.containsString("200 OK"));
|
||||||
assertEquals("http",_results.poll());
|
assertEquals("http",_results.poll());
|
||||||
assertEquals("myhost",_results.poll());
|
assertEquals("myhost",_results.poll());
|
||||||
assertEquals("80",_results.poll());
|
assertEquals("80",_results.poll());
|
||||||
assertEquals("[2001:db8:cafe::17]",_results.poll());
|
assertEquals("[2001:db8:cafe::17]",_results.poll());
|
||||||
assertEquals("0",_results.poll());
|
assertEquals("1111",_results.poll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue