hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1068881 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/auth/AuthScope.java httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
Date Wed, 09 Feb 2011 13:42:33 GMT
Author: olegk
Date: Wed Feb  9 13:42:33 2011
New Revision: 1068881

URL: http://svn.apache.org/viewvc?rev=1068881&view=rev
Log:
HTTPCLIENT-1056: Fixed bug causing the RequestAuthCache protocol interceptor to generate 
an invalid AuthScope instance when looking up user credentials for preemptive authentication

Modified:
    httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthScope.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1068881&r1=1068880&r2=1068881&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Wed Feb  9 13:42:33 2011
@@ -1,5 +1,9 @@
 Changes since 4.1
 
+* [HTTPCLIENT-1056] Fixed bug causing the RequestAuthCache protocol interceptor to generate
+  an invalid AuthScope instance when looking up user credentials for preemptive authentication.

+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1053] Fixed the way DigestScheme generates nonce-count values.  
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthScope.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthScope.java?rev=1068881&r1=1068880&r2=1068881&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthScope.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/auth/AuthScope.java
Wed Feb  9 13:42:33 2011
@@ -28,6 +28,7 @@ package org.apache.http.auth;
 
 import java.util.Locale;
 
+import org.apache.http.HttpHost;
 import org.apache.http.annotation.Immutable;
 
 import org.apache.http.util.LangUtils;
@@ -109,6 +110,20 @@ public class AuthScope {
         this.scheme = (scheme == null) ? ANY_SCHEME: scheme.toUpperCase(Locale.ENGLISH);
     }
 
+    /**
+     * @since 4.2
+     */
+    public AuthScope(final HttpHost host, final String realm, final String schemeName) {
+        this(host.getHostName(), host.getPort(), realm, schemeName);
+    }
+    
+    /**
+     * @since 4.2
+     */
+    public AuthScope(final HttpHost host) {
+        this(host, ANY_REALM, ANY_SCHEME);
+    }
+    
     /** Creates a new credentials scope for the given
      * <tt>host</tt>, <tt>port</tt>, <tt>realm</tt>,
and any
      * authentication scheme.

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java?rev=1068881&r1=1068880&r2=1068881&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
Wed Feb  9 13:42:33 2011
@@ -116,7 +116,7 @@ public class RequestAuthCache implements
         }
 
         Credentials creds = credsProvider.getCredentials(
-                new AuthScope(host.getHostName(), host.getPort(), schemeName));
+                new AuthScope(host, AuthScope.ANY_REALM, schemeName));
 
         if (creds != null) {
             authState.setAuthScheme(authScheme);



Mime
View raw message