diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java index 3e69610cf..879f3f32d 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java @@ -286,7 +286,7 @@ public class URIUtils { * * @since 4.1 */ - public static HttpHost exctractHost(final URI uri) { + public static HttpHost extractHost(final URI uri) { if (uri == null) { return null; } 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 d7a634522..ddd485070 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 @@ -634,7 +634,7 @@ public abstract class AbstractHttpClient implements HttpClient { URI requestURI = request.getURI(); if (requestURI.isAbsolute()) { - target = URIUtils.exctractHost(requestURI); + target = URIUtils.extractHost(requestURI); if (target == null) { throw new ClientProtocolException( "URI does not specify a valid host name: " + requestURI); diff --git a/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java b/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java index abc8d7822..42294740e 100644 --- a/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java +++ b/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java @@ -319,24 +319,24 @@ public class TestURIUtils { @Test public void testHTTPCLIENT_911() throws Exception{ - Assert.assertEquals(new HttpHost("localhost"),URIUtils.exctractHost(new URI("http://localhost/abcd"))); - Assert.assertEquals(new HttpHost("localhost"),URIUtils.exctractHost(new URI("http://localhost/abcd%3A"))); + Assert.assertEquals(new HttpHost("localhost"),URIUtils.extractHost(new URI("http://localhost/abcd"))); + Assert.assertEquals(new HttpHost("localhost"),URIUtils.extractHost(new URI("http://localhost/abcd%3A"))); - Assert.assertEquals(new HttpHost("local_host"),URIUtils.exctractHost(new URI("http://local_host/abcd"))); - Assert.assertEquals(new HttpHost("local_host"),URIUtils.exctractHost(new URI("http://local_host/abcd%3A"))); + Assert.assertEquals(new HttpHost("local_host"),URIUtils.extractHost(new URI("http://local_host/abcd"))); + Assert.assertEquals(new HttpHost("local_host"),URIUtils.extractHost(new URI("http://local_host/abcd%3A"))); - Assert.assertEquals(new HttpHost("localhost",8),URIUtils.exctractHost(new URI("http://localhost:8/abcd"))); - Assert.assertEquals(new HttpHost("local_host",8),URIUtils.exctractHost(new URI("http://local_host:8/abcd"))); + Assert.assertEquals(new HttpHost("localhost",8),URIUtils.extractHost(new URI("http://localhost:8/abcd"))); + Assert.assertEquals(new HttpHost("local_host",8),URIUtils.extractHost(new URI("http://local_host:8/abcd"))); // URI seems to OK with missing port number - Assert.assertEquals(new HttpHost("localhost"),URIUtils.exctractHost(new URI("http://localhost:/abcd"))); - Assert.assertEquals(new HttpHost("local_host"),URIUtils.exctractHost(new URI("http://local_host:/abcd"))); + Assert.assertEquals(new HttpHost("localhost"),URIUtils.extractHost(new URI("http://localhost:/abcd"))); + Assert.assertEquals(new HttpHost("local_host"),URIUtils.extractHost(new URI("http://local_host:/abcd"))); - Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.exctractHost(new URI("http://user:pass@localhost:8080/abcd"))); - Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.exctractHost(new URI("http://user:pass@local_host:8080/abcd"))); + Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.extractHost(new URI("http://user:pass@localhost:8080/abcd"))); + Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.extractHost(new URI("http://user:pass@local_host:8080/abcd"))); - Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.exctractHost(new URI("http://@localhost:8080/abcd"))); - Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.exctractHost(new URI("http://@local_host:8080/abcd"))); + Assert.assertEquals(new HttpHost("localhost",8080),URIUtils.extractHost(new URI("http://@localhost:8080/abcd"))); + Assert.assertEquals(new HttpHost("local_host",8080),URIUtils.extractHost(new URI("http://@local_host:8080/abcd"))); }