Fixed misspelled method name
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1053832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
261fb7d7db
commit
dafdf43025
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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")));
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue