Skip to content

Commit

Permalink
Merge pull request #40385 from stuartwdouglas/37323
Browse files Browse the repository at this point in the history
Don't close connection if response is sent
  • Loading branch information
geoand committed May 1, 2024
2 parents dd32c69 + 23f07ab commit dfc948c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,9 @@ protected void handleUnrecoverableError(Throwable throwable) {

protected void endResponse() {
if (serverResponse().headWritten()) {
serverRequest().closeConnection();
if (!serverResponse().closed()) {
serverRequest().closeConnection();
}
} else {
serverResponse().setStatusCode(500).end();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public void removeResponseHeader(String name) {

@Override
public boolean closed() {
return response.closed();
return response.ended() || response.closed();
}

@Override
Expand Down

0 comments on commit dfc948c

Please sign in to comment.