diff options
| author | luccioman <luccioman@users.noreply.github.com> | 2016-10-13 16:18:24 +0200 |
|---|---|---|
| committer | luccioman <luccioman@users.noreply.github.com> | 2016-10-13 16:18:24 +0200 |
| commit | 3ccd89e27457b41f8c9699b7a47a7b3c4d2bc9d6 (patch) | |
| tree | 7879ea600b324eeca0320e4416643d38a62eb156 /test | |
| parent | f1f4459f88fa8ee25a1823a0fbbdca45cff85492 (diff) | |
Fixed MultiProtocolURL.resolveBackpath to handle remaining '..' segments
Diffstat (limited to 'test')
| -rw-r--r-- | test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java b/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java index c8d012a7f..3236d84f6 100644 --- a/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java +++ b/test/java/net/yacy/cora/document/id/MultiProtocolURLTest.java @@ -38,15 +38,17 @@ public class MultiProtocolURLTest { String[][] testStrings = new String[][]{ new String[]{"/..home", "/..home"}, new String[]{"/test/..home/test.html", "/test/..home/test.html"}, - new String[]{"/../", "/../"}, - new String[]{"/..", "/.."}, new String[]{"/test/..", "/"}, new String[]{"/test/../", "/"}, new String[]{"/test/test2/..", "/test"}, new String[]{"/test/test2/../", "/test/"}, new String[]{"/test/test2/../hallo", "/test/hallo"}, new String[]{"/test/test2/../hallo/", "/test/hallo/"}, - new String[]{"/home/..test/../hallo/../", "/home/"} + new String[]{"/home/..test/../hallo/../", "/home/"}, + /* No path segments prior to the '..' segment : '..' still has to be removed (See https://tools.ietf.org/html/rfc3986#section-5.2.4 -> parts 2.C and 2.D )*/ + new String[]{"/../", "/"}, + new String[]{"/..", "/"}, + new String[]{"/../../../image.jpg", "/image.jpg"} }; String testhost = "http://localhost"; for (int i = 0; i < testStrings.length; i++) { @@ -223,7 +225,7 @@ public class MultiProtocolURLTest { * Test of getFileExtension method, of class MultiProtocolURL. */ @Test - public void testGetFileExtension() throws MalformedURLException { + public void testGetFileExtension() { Map<String, String> testurls = new HashMap<String, String>(); // key=testurl, value=result testurls.put("path/file.xml","xml"); // easiest |
