diff --git a/src/java/org/apache/http/impl/client/DefaultClientRequestDirector.java b/src/java/org/apache/http/impl/client/DefaultClientRequestDirector.java index 4ec97b536..68db08750 100644 --- a/src/java/org/apache/http/impl/client/DefaultClientRequestDirector.java +++ b/src/java/org/apache/http/impl/client/DefaultClientRequestDirector.java @@ -549,6 +549,12 @@ public class DefaultClientRequestDirector (proxy != null), (proxy != null)); + // Make sure redirect response body is fully consumed, if present + HttpEntity entity = response.getEntity(); + if (entity != null) { + entity.consumeContent(); + } + HttpGet redirect = new HttpGet(uri); if (LOG.isDebugEnabled()) {