Skip to content

Commit

Permalink
Properly close response body
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobEdding authored Sep 3, 2024
1 parent 72e1fe2 commit 090bd46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/bakdata/kserve/client/KServeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ private static ObjectMapper createObjectMapper() {
}

private static String getStringBody(final Response response) throws IOException {
return response.body().string();
try (ResponseBody body = response.body()) {
return body.string();
}
}

private static <T> Optional<T> processJsonResponse(final String stringBody, final Class<? extends T> responseType) {
Expand Down

0 comments on commit 090bd46

Please sign in to comment.