hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1406285 - in /httpcomponents/httpclient/branches/4.2.x: .gitignore RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Date Tue, 06 Nov 2012 19:46:56 GMT
Author: olegk
Date: Tue Nov  6 19:46:55 2012
New Revision: 1406285

URL: http://svn.apache.org/viewvc?rev=1406285&view=rev
Log:
HTTPCLIENT-1254: Redirect with underscore in hostname causes ProtocolException

Modified:
    httpcomponents/httpclient/branches/4.2.x/.gitignore
    httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java

Modified: httpcomponents/httpclient/branches/4.2.x/.gitignore
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/.gitignore?rev=1406285&r1=1406284&r2=1406285&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/.gitignore (original)
+++ httpcomponents/httpclient/branches/4.2.x/.gitignore Tue Nov  6 19:46:55 2012
@@ -1,3 +1,4 @@
+bin
 .classpath
 .project
 .settings

Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt?rev=1406285&r1=1406284&r2=1406285&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt Tue Nov  6 19:46:55 2012
@@ -1,7 +1,10 @@
 Changes since 4.2.2
 -------------------
 
-* [HTTPCLIENT-1255] AbstractVerifier incorrectly parses certificate CN containing wildcard
+* [HTTPCLIENT-1254] Redirect with underscore in hostname causes ProtocolException.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* [HTTPCLIENT-1255] AbstractVerifier incorrectly parses certificate CN containing wildcard.
   Contributed by Oleg Kalnichevski <olegk at apache.org>
 
 

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1406285&r1=1406284&r2=1406285&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Tue Nov  6 19:46:55 2012
@@ -1100,15 +1100,11 @@ public class DefaultRequestDirector impl
             redirect.setHeaders(orig.getAllHeaders());
 
             URI uri = redirect.getURI();
-            if (uri.getHost() == null) {
+            HttpHost newTarget = URIUtils.extractHost(uri);
+            if (newTarget == null) {
                 throw new ProtocolException("Redirect URI does not specify a valid host name:
" + uri);
             }
 
-            HttpHost newTarget = new HttpHost(
-                    uri.getHost(),
-                    uri.getPort(),
-                    uri.getScheme());
-
             // Reset auth states if redirecting to another host
             if (!route.getTargetHost().equals(newTarget)) {
                 this.log.debug("Resetting target auth state");



Mime
View raw message