From 3d2b0023fed592863adcbfe1518f93378f78ff54 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 27 Feb 2012 21:44:50 +0000 Subject: [PATCH] It is legal for AuthScheme to be null git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1294348 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/AuthenticationStrategyImpl.java | 6 +----- .../java/org/apache/http/impl/client/HttpAuthenticator.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java index e6263615f..3d1ff9593 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java @@ -245,17 +245,13 @@ class AuthenticationStrategyImpl implements AuthenticationStrategy { if (authhost == null) { throw new IllegalArgumentException("Host may not be null"); } - if (authScheme == null) { - throw new IllegalArgumentException("Auth scheme may not be null"); - } if (context == null) { throw new IllegalArgumentException("HTTP context may not be null"); } AuthCache authCache = (AuthCache) context.getAttribute(ClientContext.AUTH_CACHE); if (authCache != null) { if (this.log.isDebugEnabled()) { - this.log.debug("Removing from cache '" + authScheme.getSchemeName() + - "' auth scheme for " + authhost); + this.log.debug("Clearing cached auth scheme for " + authhost); } authCache.remove(authhost); } diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java index db22b64d0..034de0066 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java @@ -108,7 +108,7 @@ public class HttpAuthenticator { case HANDSHAKE: if (authScheme == null) { this.log.debug("Auth scheme is null"); - authStrategy.authFailed(host, authState.getAuthScheme(), context); + authStrategy.authFailed(host, null, context); authState.reset(); authState.setState(AuthProtocolState.FAILURE); return false;