HTTPCLIENT-1442: Authentication header set by the user gets removed in case of proxy authentication

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1548547 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-12-06 14:58:15 +00:00
parent ae429fab28
commit a86424fc43
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,10 @@
Changes since 4.3.1
-------------------
* [HTTPCLIENT-1442] Authentication header set by the user gets removed in case
of proxy authentication (affects plan HTTP requests only).
Contributed by Oleg Kalnichevski <olegk at apache.org>
* [HTTPCLIENT-1441] Caching AsynchronousValidationRequest leaks connections.
Contributed by Dominic Tootell <dominic.tootell at gmail.com>

View File

@ -293,8 +293,13 @@ public CloseableHttpResponse execute(
}
}
// discard previous auth headers
request.removeHeaders(AUTH.WWW_AUTH_RESP);
request.removeHeaders(AUTH.PROXY_AUTH_RESP);
final HttpRequest original = request.getOriginal();
if (!original.containsHeader(AUTH.WWW_AUTH_RESP)) {
request.removeHeaders(AUTH.WWW_AUTH_RESP);
}
if (!original.containsHeader(AUTH.PROXY_AUTH_RESP)) {
request.removeHeaders(AUTH.PROXY_AUTH_RESP);
}
} else {
break;
}