diff --git a/VERSION.txt b/VERSION.txt index 964d218dea3..f213d20ee44 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,5 +1,6 @@ jetty-7.1-SNAPSHOT + + 306349 ProxyServlet does not work unless deployed at / + 307847 Fixed combining mime type parameters + 307898 Handle large/async websocket messages + JETTY-1202 Use platform default algorithm for SecureRandom diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java index 767c5aed129..6193d79d578 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java @@ -20,6 +20,8 @@ import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.MalformedURLException; import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; import java.util.Enumeration; import java.util.HashSet; @@ -200,19 +202,19 @@ public class ProxyServlet implements Servlet if (request.getQueryString()!=null) uri+="?"+request.getQueryString(); - HttpURI url=proxyHttpURI(request.getScheme(), - request.getServerName(), - request.getServerPort(), - uri); - - if (debug!=0) - _log.debug(debug+" proxy "+uri+"-->"+url); - - if (url==null) - { - response.sendError(HttpServletResponse.SC_FORBIDDEN); - return; - } + HttpURI url=proxyHttpURI(request.getScheme(), + request.getServerName(), + request.getServerPort(), + uri); + + if (debug!=0) + _log.debug(debug+" proxy "+uri+"-->"+url); + + if (url==null) + { + response.sendError(HttpServletResponse.SC_FORBIDDEN); + return; + } HttpExchange exchange = new HttpExchange() { @@ -299,7 +301,7 @@ public class ProxyServlet implements Servlet exchange.setScheme(HttpSchemes.HTTPS.equals(request.getScheme())?HttpSchemes.HTTPS_BUFFER:HttpSchemes.HTTP_BUFFER); exchange.setMethod(request.getMethod()); - exchange.setURL(url.toString()); + exchange.setURL(url.toString()); exchange.setVersion(request.getProtocol()); if (debug!=0) @@ -452,53 +454,84 @@ public class ProxyServlet implements Servlet /** * Transparent Proxy. * - * This convenience extension to ProxyServlet configures the servlet - * as a transparent proxy. The servlet is configured with init parameter: