-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1808, fix URL parsing problem when user filed con…
…tains '@' characters. Fixed #1470
- Loading branch information
1 parent
b48e8ba
commit 3c55c80
Showing
2 changed files
with
16 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -637,4 +637,19 @@ public void testAddParameters() throws Exception { | |
parameters.put("version", null); | ||
url.addParameters(parameters); | ||
} | ||
|
||
@Test | ||
public void testUserNamePasswordContainsAt(){ | ||
// Test username or password contains "@" | ||
URL url = URL.valueOf("ad@min:hello@[email protected]:20880/context/path?version=1.0.0&application=morgan"); | ||
assertNull(url.getProtocol()); | ||
assertEquals("ad@min", url.getUsername()); | ||
assertEquals("hello@1234", url.getPassword()); | ||
assertEquals("10.20.130.230", url.getHost()); | ||
assertEquals(20880, url.getPort()); | ||
assertEquals("context/path", url.getPath()); | ||
assertEquals(2, url.getParameters().size()); | ||
assertEquals("1.0.0", url.getParameter("version")); | ||
assertEquals("morgan", url.getParameter("application")); | ||
} | ||
} |