Skip to content

Commit

Permalink
PR #12633 - inline closeOutput method in ServletApiResponse
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Dec 12, 2024
1 parent 5485450 commit a40ee1e
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a40ee1e

Please sign in to comment.