Made easier for subclasses to customize the response code in case of

rewrite failed.
This commit is contained in:
Simone Bordet 2014-04-01 15:50:41 +02:00
parent a1d20956b1
commit 860ea9c329
1 changed files with 6 additions and 1 deletions

View File

@ -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());