Details
-
Bug
-
Resolution: Cannot Reproduce
-
Major - P3
-
None
-
2.6.5
-
None
Description
Repro steps:
|
JUnit Test Snippet |
@Test
|
public void testMultipleAts() {
|
MongoURI uri = new MongoURI("mongodb://usernme:p@ssword@localhost:27017/test");
|
assertEquals("p@ssword", uri.getPassword()); // <-- FAILS
|
|
|
// this behavior might be expected behavior as '@' should be URI-escaped
|
// however maybe a parse error should be thrown since at this point:
|
// * uri.getHosts() == ["ssword@localhost:27017"]
|
// * uri.getPassword() == ['p']
|
}
|
|
|
@Test
|
public void testUriEscaping() {
|
MongoURI uri = new MongoURI("mongodb://usernme:p%40ssword@localhost:27017/test");
|
assertEquals("p@ssword", uri.getPassword()); // <-- FAILS and shouldn't
|
|
|
// at this point uri.getPassword() == ['p', '%', '4', '0', 's', 's', 'w', 'o', 'r', 'd']
|
// which is wrong
|
}
|
Expected:
- MongoURI should support URI escaping.
Actual:
- No URI escaping/unescaping is handled in MongoURI