Fix HER-1792 backslashes in urls can in some cases really mean backslashes

(specifically, when they're in the query string)
* UURIFactory.java
    fixup() - replace \ with / up to the first ? in the url, instead of
    anywhere in the url
    and update comments
* UURIFactoryTest.java
    backslash test
This commit is contained in:
nlevitt committed 2011-04-19 02:11:20 +00:00
1 parent 2be8af10a9
commit b064d43db5
2 files changed
+32 -14

No files matched your search

@@ -1166,4 +1166,17 @@ public class UURIFactoryTest extends TestCase {
base.resolve(relative);
UURIFactory.getInstance(base,relative);
}
/**
* To match IE behavior, backslashes in path-info (really, anywhere before
* query string) assumed to be slashes, to match IE behavior. In
* query-string, they are escaped to %5C.
*
* @throws URIException
*/
public void testBackslashes() throws URIException {
UURI uuri = UURIFactory.getInstance("http:\\/www.example.com\\a/b\\c/d?q\\r\\|s/t\\v");
String expected = "http://www.example.com/a/b/c/d?q%5Cr%5C|s/t%5Cv";
assertEquals(expected, uuri.toString());
}
}