hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r916645 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Date Fri, 26 Feb 2010 11:01:12 GMT
Author: olegk
Date: Fri Feb 26 11:01:12 2010
New Revision: 916645

URL: http://svn.apache.org/viewvc?rev=916645&view=rev
Log:
HTTPCLIENT-911: test whether redirect URL contains a valid hostname

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=916645&r1=916644&r2=916645&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Fri Feb 26 11:01:12 2010
@@ -1033,7 +1033,10 @@
             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(),



Mime
View raw message