hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1467942 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java httpclient/src/main/java/org/apache/http/impl/execchain/RedirectExec.java
Date Mon, 15 Apr 2013 11:36:34 GMT
Author: olegk
Date: Mon Apr 15 11:36:34 2013
New Revision: 1467942

URL: http://svn.apache.org/r1467942
Log:
 Redirects with underscore character in the location hostname cause IllegalArgumentException

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

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1467942&r1=1467941&r2=1467942&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Mon Apr 15 11:36:34 2013
@@ -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>

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=1467942&r1=1467941&r2=1467942&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
Mon Apr 15 11:36:34 2013
@@ -462,8 +462,7 @@ public class DefaultRequestDirector impl
                 } 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) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/RedirectExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/RedirectExec.java?rev=1467942&r1=1467941&r2=1467942&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/RedirectExec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/RedirectExec.java
Mon Apr 15 11:36:34 2013
@@ -113,7 +113,7 @@ public class RedirectExec implements Cli
 
                     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);
                     }



Mime
View raw message