From 769484f71e9b5eb4b00611555a9c5bb8649d239c Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 23 Apr 2008 21:32:33 +0000 Subject: [PATCH] Copy request headers from the original request to the redirected request git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@651072 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/DefaultClientRequestDirector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java b/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java index 002f0449b..86903cafc 100644 --- a/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java +++ b/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java @@ -813,6 +813,10 @@ public class DefaultClientRequestDirector uri.getScheme()); HttpGet redirect = new HttpGet(uri); + + HttpRequest orig = request.getOriginal(); + redirect.setHeaders(orig.getAllHeaders()); + RequestWrapper wrapper = new RequestWrapper(redirect); wrapper.setParams(params);