diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java index 518051d6901..29b34f378fd 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AsyncProxyServlet.java @@ -85,7 +85,7 @@ public class AsyncProxyServlet extends ProxyServlet catch (Throwable x) { callback.failed(x); - onResponseFailure(request, response, proxyResponse, x); + proxyResponse.abort(x); } } @@ -279,8 +279,7 @@ public class AsyncProxyServlet extends ProxyServlet @Override public void onError(Throwable failure) { - HttpServletResponse response = (HttpServletResponse)request.getAsyncContext().getResponse(); - onResponseFailure(request, response, proxyResponse, failure); + proxyResponse.abort(failure); } }