Made easier for subclasses to customize the response code in case of
rewrite failed.
This commit is contained in:
parent
a1d20956b1
commit
860ea9c329
|
@ -385,7 +385,7 @@ public class ProxyServlet extends HttpServlet
|
||||||
|
|
||||||
if (rewrittenURI == null)
|
if (rewrittenURI == null)
|
||||||
{
|
{
|
||||||
response.sendError(HttpServletResponse.SC_FORBIDDEN);
|
onRewriteFailed(request, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,6 +490,11 @@ public class ProxyServlet extends HttpServlet
|
||||||
proxyRequest.send(new ProxyResponseListener(request, response));
|
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)
|
protected Request addViaHeader(Request proxyRequest)
|
||||||
{
|
{
|
||||||
return proxyRequest.header(HttpHeader.VIA, "http/1.1 " + getViaHost());
|
return proxyRequest.header(HttpHeader.VIA, "http/1.1 " + getViaHost());
|
||||||
|
|
Loading…
Reference in New Issue