hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r789408 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Date Mon, 29 Jun 2009 18:43:52 GMT
Author: olegk
Date: Mon Jun 29 18:43:51 2009
New Revision: 789408

URL: http://svn.apache.org/viewvc?rev=789408&view=rev
Log:
HTTPCLIENT-856: Proxy NTLM authentication no longer fails on a redirect to a different host

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

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=789408&r1=789407&r2=789408&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Mon Jun 29 18:43:51 2009
@@ -1,8 +1,12 @@
 Changes since 4.0 beta 2
 -------------------
 
+* [HTTPCLIENT-856] Proxy NTLM authentication no longer fails on a redirect to
+  a different host.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-841] Removed automatic connection release using garbage collection 
-  due to a memory leak
+  due to a memory leak.
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 
 * [HTTPCLIENT-853] Fixed bug causing invalid cookie origin port to be selected 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=789408&r1=789407&r2=789408&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Mon Jun 29 18:43:51 2009
@@ -925,7 +925,6 @@
         throws HttpException, IOException {
 
         HttpRoute route = roureq.getRoute();
-        HttpHost proxy = route.getProxyHost();
         RequestWrapper request = roureq.getRequest();
         
         HttpParams params = request.getParams();
@@ -948,6 +947,14 @@
                     uri.getPort(),
                     uri.getScheme());
             
+            if (!route.getTargetHost().equals(newTarget)) {
+                targetAuthState.invalidate();
+                AuthScheme authScheme = proxyAuthState.getAuthScheme();
+                if (authScheme != null && authScheme.isConnectionBased()) {
+                    proxyAuthState.invalidate();
+                }
+            }
+            
             HttpGet redirect = new HttpGet(uri);
             
             HttpRequest orig = request.getOriginal();
@@ -1007,6 +1014,8 @@
             
             if (this.proxyAuthHandler.isAuthenticationRequested(response, context)) {
 
+                HttpHost proxy = route.getProxyHost();
+                
                 this.log.debug("Proxy requested authentication");
                 Map<String, Header> challenges = this.proxyAuthHandler.getChallenges(
                         response, context);



Mime
View raw message