From 87a7ff550b5d01d8e22439a757a900364bf2c36c Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 23 Dec 2016 13:44:19 +1100 Subject: [PATCH] Fixes #1201 --- .../src/main/config/etc/jetty-http-forwarded.xml | 2 +- .../server/ForwardedRequestCustomizerTest.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/jetty-server/src/main/config/etc/jetty-http-forwarded.xml b/jetty-server/src/main/config/etc/jetty-http-forwarded.xml index a842e0a4eff..50b80976a2a 100644 --- a/jetty-server/src/main/config/etc/jetty-http-forwarded.xml +++ b/jetty-server/src/main/config/etc/jetty-http-forwarded.xml @@ -11,7 +11,7 @@ - + diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java index 9fcfc8e001b..8723b995a5a 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java @@ -202,6 +202,22 @@ public class ForwardedRequestCustomizerTest assertEquals("0",_results.poll()); } + @Test + public void testFor() throws Exception + { + String response=_connector.getResponse( + "GET / HTTP/1.1\n"+ + "Host: myhost\n"+ + "X-Forwarded-For: 10.9.8.7,6.5.4.3\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()); + } + @Test public void testLegacyProto() throws Exception {