From 0b5e40c11d91a81dbbc8355b41f7a3b04a93db9b Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Mon, 13 Dec 2010 20:33:05 +0000 Subject: [PATCH] Revert accidental changes made in r980937 git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1045364 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/AbstractHttpClient.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java index e3a02380c..7480c842d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java @@ -632,16 +632,10 @@ public abstract class AbstractHttpClient implements HttpClient { URI requestURI = request.getURI(); if (requestURI.isAbsolute()) { - String ssp = requestURI.getSchemeSpecificPart(); - ssp = ssp.substring(2, ssp.length()); //remove "//" prefix - int end = ssp.indexOf(':') > 0 ? ssp.indexOf(':') : - ssp.indexOf('/') > 0 ? ssp.indexOf('/') : - ssp.indexOf('?') > 0 ? ssp.indexOf('?') : ssp.length(); - String host = ssp.substring(0, end); - + String host = requestURI.getHost(); int port = requestURI.getPort(); String scheme = requestURI.getScheme(); - if (host == null || "".equals(host)) { + if (host == null) { throw new ClientProtocolException( "URI does not specify a valid host name: " + requestURI); }