From 8c0e4f53d3c7f6e6370c51f65b5d74a0a2f051a2 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 13 Aug 2015 18:12:38 +1000 Subject: [PATCH] 474634 - AsyncListener.onError() handling. Fixed AsyncContextTests --- .../src/main/java/org/eclipse/jetty/server/HttpChannel.java | 1 + .../test/java/org/eclipse/jetty/servlet/AsyncContextTest.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index f2bfc864c28..576b6d7efaf 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -319,6 +319,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor case ERROR_DISPATCH: { _request.setHandled(false); + _response.resetBuffer(); _response.getHttpOutput().reopen(); _request.setDispatcherType(DispatcherType.ERROR); diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java index 14c951c0e2b..c8ce6638f7f 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java @@ -173,7 +173,6 @@ public class AsyncContextTest "Connection: close\r\n" + "\r\n"; String responseString = _connector.getResponses(request); - System.err.println(responseString); BufferedReader br = new BufferedReader(new StringReader(responseString)); @@ -411,7 +410,7 @@ public class AsyncContextTest BufferedReader br = new BufferedReader(new StringReader(responseString)); - assertEquals("HTTP/1.1 500 Async Exception",br.readLine()); + assertEquals("HTTP/1.1 500 Server Error",br.readLine()); br.readLine();// connection close br.readLine();// server br.readLine();// empty