diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java index 8207b986bfc..065937c1eb7 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java @@ -385,7 +385,7 @@ public class ProxyServlet extends HttpServlet if (rewrittenURI == null) { - response.sendError(HttpServletResponse.SC_FORBIDDEN); + onRewriteFailed(request, response); return; } @@ -490,6 +490,11 @@ public class ProxyServlet extends HttpServlet proxyRequest.send(new ProxyResponseListener(request, response)); } + protected void onRewriteFailed(HttpServletRequest request, HttpServletResponse response) throws IOException + { + response.sendError(HttpServletResponse.SC_FORBIDDEN); + } + protected Request addViaHeader(Request proxyRequest) { return proxyRequest.header(HttpHeader.VIA, "http/1.1 " + getViaHost());