From fe173454e1a12c1188eda107549042641f7b0147 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 26 Apr 2017 15:38:18 +0200 Subject: [PATCH] Fixed #1500 --- .../src/main/java/org/eclipse/jetty/server/Response.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index 1448b990e99..46823260f24 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -653,9 +653,8 @@ public class Response implements HttpServletResponse ErrorHandler error_handler = ErrorHandler.getErrorHandler(_channel.getServer(), contextHandler); if (error_handler!=null) error_handler.handle(null, request, request, this); - else - closeOutput(); } + closeOutput(); } /** @@ -1040,10 +1039,12 @@ public class Response implements HttpServletResponse _out.close(); break; case STREAM: - getOutputStream().close(); + if (!_out.isClosed()) + getOutputStream().close(); break; default: - _out.close(); + if (!_out.isClosed()) + _out.close(); } }