mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-10 03:56:17 +00:00
Redirects with underscore character in the location hostname cause IllegalArgumentException
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1467942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
485f06bb27
commit
5769675b15
@ -1,6 +1,10 @@
|
||||
Changes since release 4.3 BETA1
|
||||
-------------------
|
||||
|
||||
* [HTTPCLIENT-1342] Redirects with underscore character in the location hostname cause
|
||||
"java.lang.IllegalArgumentException: Host name may not be null".
|
||||
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||
|
||||
* [HTTPCLIENT-1338] (regression) Invalidated / stale DIGEST schemes do not get evicted from
|
||||
the auth cache.
|
||||
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||
|
@ -462,8 +462,7 @@ public HttpResponse execute(HttpHost target, final HttpRequest request,
|
||||
} else {
|
||||
final URI requestURI = wrapper.getURI();
|
||||
if (requestURI.isAbsolute()) {
|
||||
target = new HttpHost(
|
||||
requestURI.getHost(), requestURI.getPort(), requestURI.getScheme());
|
||||
target = URIUtils.extractHost(requestURI);
|
||||
}
|
||||
}
|
||||
if (target == null) {
|
||||
|
@ -113,7 +113,7 @@ public CloseableHttpResponse execute(
|
||||
|
||||
final URI uri = currentRequest.getURI();
|
||||
final HttpHost newTarget = URIUtils.extractHost(uri);
|
||||
if (uri.getHost() == null) {
|
||||
if (newTarget == null) {
|
||||
throw new ProtocolException("Redirect URI does not specify a valid host name: " +
|
||||
uri);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user