From a40ee1e1446cda6183bbd4cacc30d52717e6074c Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Fri, 13 Dec 2024 09:35:41 +1100 Subject: [PATCH] PR #12633 - inline closeOutput method in ServletApiResponse Signed-off-by: Lachlan Roberts --- .../jetty/ee10/servlet/ServletApiResponse.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiResponse.java b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiResponse.java index 5037a57493a5..4f6ac985fa9f 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiResponse.java +++ b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiResponse.java @@ -186,17 +186,14 @@ public void sendRedirect(int code, String location) throws IOException { Response.sendRedirect(getServletRequestInfo().getRequest(), getResponse(), callback, code, location, false); callback.block(); - closeOutput(); - } - } - public void closeOutput() throws IOException - { - ServletResponseInfo info = getServletResponseInfo(); - if (info.getOutputType() == ServletContextResponse.OutputType.WRITER) - info.getWriter().close(); - else - _servletChannel.getHttpOutput().close(); + // Close the HttpOutput. + ServletResponseInfo info = getServletResponseInfo(); + if (info.getOutputType() == ServletContextResponse.OutputType.WRITER) + info.getWriter().close(); + else + _servletChannel.getHttpOutput().close(); + } } @Override