diff --git a/client-runtime/src/main/java/com/microsoft/rest/retry/RetryHandler.java b/client-runtime/src/main/java/com/microsoft/rest/retry/RetryHandler.java index e56c061de6a01..649a769af99f0 100644 --- a/client-runtime/src/main/java/com/microsoft/rest/retry/RetryHandler.java +++ b/client-runtime/src/main/java/com/microsoft/rest/retry/RetryHandler.java @@ -67,11 +67,11 @@ public Response intercept(Chain chain) throws IOException { // try the request Response response = chain.proceed(request); - response.body().close(); int tryCount = 0; while (retryStrategy.shouldRetry(tryCount, response)) { tryCount++; + response.body().close(); // retry the request response = chain.proceed(request); }