From 686653ac98f5d9892a655cd4dcc54b5c20301633 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 11 Aug 2021 17:44:36 +0200 Subject: [PATCH] Close response bodies after successfully setting statuses --- .../com/spotify/github/v3/clients/RepositoryClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/spotify/github/v3/clients/RepositoryClient.java b/src/main/java/com/spotify/github/v3/clients/RepositoryClient.java index 5039efc9..b00aa51f 100644 --- a/src/main/java/com/spotify/github/v3/clients/RepositoryClient.java +++ b/src/main/java/com/spotify/github/v3/clients/RepositoryClient.java @@ -221,7 +221,11 @@ public CompletableFuture setCommitStatus( final String path = String.format(STATUS_URI_TEMPLATE, owner, repo, sha); return github .post(path, github.json().toJsonUnchecked(request)) - .thenAccept(IGNORE_RESPONSE_CONSUMER); + .thenAccept(response -> { + if (response.body() != null) { + response.body().close(); + } + }); } /**