hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [1/2] httpcomponents-client git commit: HTTPCLIENT-1855: Removed code causing unnecessary auth cache updated; Reverted 7e44b96
Date Fri, 20 Oct 2017 09:52:58 GMT
Repository: httpcomponents-client
Updated Branches:
  refs/heads/4.5.x cfbbea0ee -> 1383e1f78


HTTPCLIENT-1855: Removed code causing unnecessary auth cache updated; Reverted 7e44b96


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/aa818657
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/aa818657
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/aa818657

Branch: refs/heads/4.5.x
Commit: aa81865776f4d664b829981071fbd9fd83203d6f
Parents: cfbbea0
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Thu Oct 19 20:07:49 2017 +0200
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Thu Oct 19 20:07:49 2017 +0200

----------------------------------------------------------------------
 .../http/client/protocol/RequestAuthCache.java  |  7 -----
 .../client/protocol/TestRequestAuthCache.java   | 27 --------------------
 2 files changed, 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/aa818657/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
index 7bf37e6..ab68515 100644
--- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
+++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
@@ -44,7 +44,6 @@ import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.conn.routing.RouteInfo;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.Args;
@@ -136,12 +135,6 @@ public class RequestAuthCache implements HttpRequestInterceptor {
         final Credentials creds = credsProvider.getCredentials(authScope);
 
         if (creds != null) {
-            if (AuthSchemes.BASIC.equalsIgnoreCase(authScheme.getSchemeName())
-                    || AuthSchemes.DIGEST.equalsIgnoreCase(authScheme.getSchemeName())) {
-                authState.setState(AuthProtocolState.CHALLENGED);
-            } else {
-                authState.setState(AuthProtocolState.SUCCESS);
-            }
             authState.update(authScheme, creds);
         } else {
             this.log.debug("No credentials for preemptive authentication");

http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/aa818657/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
----------------------------------------------------------------------
diff --git a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
index 1c0d323..3f0d8e9 100644
--- a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
+++ b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
@@ -124,33 +124,6 @@ public class TestRequestAuthCache {
     }
 
     @Test
-    public void testPreemptiveTargetAndProxyAuthDigest() throws Exception {
-        final HttpRequest request = new BasicHttpRequest("GET", "/");
-
-        final HttpClientContext context = HttpClientContext.create();
-        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null,
this.proxy, false));
-        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
-
-        final AuthCache authCache = new BasicAuthCache();
-        authCache.put(this.target, this.digestAuthscheme1);
-        authCache.put(this.proxy, this.digestAuthscheme2);
-
-        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
-
-        final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
-        Assert.assertNotNull(this.targetState.getAuthScheme());
-        Assert.assertSame(this.targetState.getState(), AuthProtocolState.CHALLENGED);
-        Assert.assertSame(this.creds1, this.targetState.getCredentials());
-        Assert.assertNotNull(this.proxyState.getAuthScheme());
-        Assert.assertSame(this.proxyState.getState(), AuthProtocolState.CHALLENGED);
-        Assert.assertSame(this.creds2, this.proxyState.getCredentials());
-    }
-
-    @Test
     public void testCredentialsProviderNotSet() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 


Mime
View raw message