diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index a57d7eda275..4d5c6496535 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -574,6 +574,8 @@ public class HttpChannelState { synchronized (this) { + if (_state==State.DISPATCHED) + return _async!=null; return _async==Async.STARTED || _async==Async.EXPIRING; } } diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java index 5693dd1fb66..6e15fa1728c 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java @@ -352,7 +352,6 @@ public class GzipFilter extends UserAgentFilter { if (request.isAsyncStarted()) { - request.getAsyncContext().addListener(new FinishOnCompleteListener(wrappedResponse)); } else if (exceptional && !response.isCommitted())