Skip to content

Commit

Permalink
Merge pull request #46426 from gsmet/fix-re-os-3.15
Browse files Browse the repository at this point in the history
WIP - [3.15] Always close OutputStream in RESTEasy Classic
  • Loading branch information
gsmet authored Feb 25, 2025
2 parents 5234c9b + c667a2a commit 70ffbd0
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,18 @@ private void transformHeadersList(final String key, final List<Object> valueList

public void finish() throws IOException {
checkException();
if (finished || response.ended() || response.closed())

if (finished || response.ended() || response.closed()) {
if (os != null) {
try {
os.close();
os = null;
} catch (Exception ignored) {

}
}
return;
}
try {
if (os != null) {
os.close(); // this will end() vertx response
Expand Down

0 comments on commit 70ffbd0

Please sign in to comment.