Skip to content

Commit

Permalink
[Test] Force close of HTTP response stream
Browse files Browse the repository at this point in the history
In JDK23 the `HttpServer` requires that http response be explicitly
closed (even if there is no response body)

Resolves: elastic#109452
  • Loading branch information
tvernum committed Jun 11, 2024
1 parent f75afb0 commit 97c6ebf
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private static void configureMetadataResource(int realmNumber) throws Certificat
} else {
if (randomBoolean()) {
http.sendResponseHeaders(randomFrom(404, 401, 403, 500), 0);
http.getResponseBody().close();
} else {
sendXmlContent("not valid xml", http);
}
Expand Down

0 comments on commit 97c6ebf

Please sign in to comment.