Skip to content

Commit 69bf4b7

Browse files
committed
- fixes a bug where the retry handler could fail on chunked encoding responses
1 parent 3141c2b commit 69bf4b7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ public Response intercept(@Nonnull final Chain chain) throws IOException {
197197
while(retryRequest(response, executionCount, request, retryOption)) {
198198
request = request.newBuilder().addHeader(RETRY_ATTEMPT_HEADER, String.valueOf(executionCount)).build();
199199
executionCount++;
200-
if(response != null && response.body() != null) {
201-
response.body().close();
200+
if(response != null) {
201+
if(response.body() != null)
202+
response.body().close();
203+
response.close();
202204
}
203205
response = chain.proceed(request);
204206
}

0 commit comments

Comments
 (0)