hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1548548 - in /httpcomponents/httpasyncclient/trunk: RELEASE_NOTES.txt httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java
Date Fri, 06 Dec 2013 14:58:44 GMT
Author: olegk
Date: Fri Dec  6 14:58:44 2013
New Revision: 1548548

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

Modified:
    httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java

Modified: httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt?rev=1548548&r1=1548547&r2=1548548&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt Fri Dec  6 14:58:44 2013
@@ -1,6 +1,10 @@
 Changes since 4.0
 -------------------
 
+* [HTTPCLIENT-1442] Authentication header set by the user gets removed in case
+  of proxy authentication.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPASYNC-60] Fixed incorrect OSGi Symbolic-BundleName.
   Contributed by M. van Cuijk <mark at phedny.net>
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java?rev=1548548&r1=1548547&r2=1548548&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/MainClientExec.java
Fri Dec  6 14:58:44 2013
@@ -589,9 +589,14 @@ class MainClientExec implements Internal
         if (config.isAuthenticationEnabled()) {
             if (needAuthentication(state)) {
                 // discard previous auth headers
-                final HttpRequest currentRequest = state.getCurrentRequest();
-                currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
-                currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
+                final HttpRequestWrapper currentRequest = state.getCurrentRequest();
+                final HttpRequest original = currentRequest.getOriginal();
+                if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
+                    currentRequest.removeHeaders(AUTH.WWW_AUTH_RESP);
+                }
+                if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
+                    currentRequest.removeHeaders(AUTH.PROXY_AUTH_RESP);
+                }
                 return true;
             }
         }



Mime
View raw message