From 6a2ecc493e010ff33c4280a1d7aa5dfe7ae78283 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 13 May 2011 09:21:47 +0000 Subject: [PATCH] 345704 jetty-nested works with forwarded SSL in cloudfoundry git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3140 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../jetty/nested/NestedConnection.java | 4 - .../eclipse/jetty/nested/NestedRequest.java | 4 +- .../jetty/server/AbstractConnector.java | 207 ++++++++++-------- .../src/main/webapp/WEB-INF/jetty.xml | 5 +- test-jetty-nested/src/main/webapp/wibble.txt | 0 6 files changed, 127 insertions(+), 94 deletions(-) delete mode 100644 test-jetty-nested/src/main/webapp/wibble.txt diff --git a/VERSION.txt b/VERSION.txt index af069cb6552..52e191839de 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -21,6 +21,7 @@ jetty-7.4.1.v20110513 + 345290 Weak references from SessionIdManager. HashSessionManager cleanup. + 345543 Always close endpoint on SSLException + 345679 Allow setting an initialized KeyStore as keystore/truststore of SslContextFactory + + 345704 jetty-nested works with forwarded SSL in cloudfoundry + JETTY-954 WebAppContext eats any start exceptions instead of stopping the server load + JETTY-1314 Handle bad URI encodings + JETTY-1324 Tested not using CESU-8 instead of UTF-8 diff --git a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java index 028cd6151c7..045afc17e35 100644 --- a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java +++ b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedConnection.java @@ -64,10 +64,6 @@ public class NestedConnection extends HttpConnection fields.add(header,value); } - // Slight hack for cloud foundry - if (!fields.containsKey("x-forwarded-for") && outerRequest.getHeader("x-forwarded_for")!=null) - fields.add("x-forwarded-for",outerRequest.getHeader("x-forwarded_for")); - // Let outer parse the cookies _request.setCookies(outerRequest.getCookies()); diff --git a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedRequest.java b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedRequest.java index 64b74aafe20..083872c082e 100644 --- a/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedRequest.java +++ b/jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedRequest.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.nested; import javax.servlet.http.HttpServletRequest; +import org.eclipse.jetty.http.HttpSchemes; import org.eclipse.jetty.server.Request; public class NestedRequest extends Request @@ -33,8 +34,7 @@ public class NestedRequest extends Request public boolean isSecure() { - return _outer.isSecure(); + return _outer.isSecure() || HttpSchemes.HTTPS.equals(getScheme()); } - } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 5954ffdb288..cac503fa0ba 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -38,8 +38,7 @@ import org.eclipse.jetty.util.statistic.SampleStatistic; import org.eclipse.jetty.util.thread.ThreadPool; /** - * Abstract Connector implementation. This abstract implementation of the - * Connector interface provides: + * Abstract Connector implementation. This abstract implementation of the Connector interface provides: *