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:
Oleg Kalnichevski 2010-02-26 11:01:12 +00:00
parent 39a0d0a620
commit bac075735d
1 changed files with 4 additions and 1 deletions

View File

@ -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(),