Skip to content

Commit 3ecab75

Browse files
committed
- fixes a bug where the retry handler could leak responses
1 parent 5f65372 commit 3ecab75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/microsoft/graph/httpcore/RetryHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public Response intercept(Chain chain) throws IOException {
147147
while(retryRequest(response, executionCount, request, retryOption)) {
148148
request = request.newBuilder().addHeader(RETRY_ATTEMPT_HEADER, String.valueOf(executionCount)).build();
149149
executionCount++;
150+
if(response != null && response.body() != null) {
151+
response.body().close();
152+
}
150153
response = chain.proceed(request);
151154
}
152155
return response;

0 commit comments

Comments
 (0)