hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1548547 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
Date Fri, 06 Dec 2013 14:58:16 GMT
Author: olegk
Date: Fri Dec  6 14:58:15 2013
New Revision: 1548547

URL: http://svn.apache.org/r1548547
Log:
HTTPCLIENT-1442: Authentication header set by the user gets removed in case of proxy authentication

Modified:
    httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1548547&r1=1548546&r2=1548547&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Fri Dec  6 14:58:15 2013
@@ -1,6 +1,10 @@
 Changes since 4.3.1
 -------------------
 
+* [HTTPCLIENT-1442] Authentication header set by the user gets removed in case
+  of proxy authentication (affects plan HTTP requests only).
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1441] Caching AsynchronousValidationRequest leaks connections.
   Contributed by Dominic Tootell <dominic.tootell at gmail.com>
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1548547&r1=1548546&r2=1548547&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
Fri Dec  6 14:58:15 2013
@@ -293,8 +293,13 @@ public class MainClientExec implements C
                         }
                     }
                     // discard previous auth headers
-                    request.removeHeaders(AUTH.WWW_AUTH_RESP);
-                    request.removeHeaders(AUTH.PROXY_AUTH_RESP);
+                    final HttpRequest original = request.getOriginal();
+                    if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
+                        request.removeHeaders(AUTH.WWW_AUTH_RESP);
+                    }
+                    if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
+                        request.removeHeaders(AUTH.PROXY_AUTH_RESP);
+                    }
                 } else {
                     break;
                 }



Mime
View raw message