Skip to content

Commit

Permalink
Fix builder http leak (#9011)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr authored Jan 17, 2025
1 parent 671cd35 commit 40b2f8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected <T> boolean handleResponseError(
if (response.isSuccessful()) {
return false;
}
try {
try (response) {
if (response.code() == SC_UNSUPPORTED_MEDIA_TYPE) {
futureResponse.complete(Response.fromUnsupportedMediaTypeError());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void handleResponse(final Request request, final okhttp3.Response response) {
if (handleResponseError(request, response, futureResponse)) {
return;
}
response.close();
futureResponse.complete(Response.fromNullPayload());
}

Expand Down

0 comments on commit 40b2f8f

Please sign in to comment.