Skip to content

Commit

Permalink
[UNDERTOW-1747] use isResponseStarted()
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s authored and fl4via committed Aug 24, 2020
1 parent 80138c4 commit 0fcf0bb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void handleRequest(final HttpServerExchange exchange) throws Exception {
ServletRequestContext src = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);

// If the servlet is available and the status code has been set to an error, return the error page
if( src != null && exchange.getStatusCode() > 399 && exchange.getResponseContentLength() == -1 ) {
if( src != null && exchange.getStatusCode() > 399 && !exchange.isResponseStarted() ) {
((HttpServletResponse)src.getServletResponse()).sendError(exchange.getStatusCode());
} else {
next.handleRequest(exchange);
Expand Down

0 comments on commit 0fcf0bb

Please sign in to comment.