-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorrect handling of malformed authority component by URIUtils#extra…
…ctHost
- Loading branch information
Showing
2 changed files
with
32 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,14 +273,16 @@ public void testExtractHost() throws Exception { | |
|
||
Assert.assertEquals(new HttpHost("localhost",8080), | ||
URIUtils.extractHost(new URI("http://localhost:8080/;sessionid=stuff/abcd"))); | ||
Assert.assertEquals(new HttpHost("localhost",8080), | ||
Assert.assertEquals(null, | ||
URIUtils.extractHost(new URI("http://localhost:8080;sessionid=stuff/abcd"))); | ||
Assert.assertEquals(new HttpHost("localhost",-1), | ||
Assert.assertEquals(null, | ||
URIUtils.extractHost(new URI("http://localhost:;sessionid=stuff/abcd"))); | ||
Assert.assertEquals(null, | ||
URIUtils.extractHost(new URI("http://:80/robots.txt"))); | ||
Assert.assertEquals(null, | ||
URIUtils.extractHost(new URI("http://some%20domain:80/robots.txt"))); | ||
Assert.assertEquals(null, | ||
URIUtils.extractHost(new URI("http://[email protected]:[email protected]/"))); | ||
} | ||
|
||
@Test | ||
|