HTTPCLIENT-911: test whether redirect URL contains a valid hostname
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@916645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
39a0d0a620
commit
bac075735d
|
@ -1033,7 +1033,10 @@ public class DefaultRequestDirector implements RequestDirector {
|
|||
redirect.setHeaders(orig.getAllHeaders());
|
||||
|
||||
URI uri = redirect.getURI();
|
||||
|
||||
if (uri.getHost() == null) {
|
||||
throw new ProtocolException("Redirect URI does not specify a valid host name: " + uri);
|
||||
}
|
||||
|
||||
HttpHost newTarget = new HttpHost(
|
||||
uri.getHost(),
|
||||
uri.getPort(),
|
||||
|
|
Loading…
Reference in New Issue