File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
jetty-core/jetty-util/src
main/java/org/eclipse/jetty/util
test/java/org/eclipse/jetty/util Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1944,7 +1944,7 @@ public static URI toURI(String reference)
19441944 }
19451945 {
19461946 // Anything else, scheme wise, is acceptable.
1947- return uri ;
1947+ return correctURI ( uri ) ;
19481948 }
19491949 }
19501950 if (LOG .isDebugEnabled ())
Original file line number Diff line number Diff line change @@ -1091,7 +1091,8 @@ public static Stream<Arguments> toURICases()
10911091 args .add (Arguments .of ("file:///D:/path/to/zed.jar" , "file:///D:/path/to/zed.jar" ));
10921092 args .add (Arguments .of ("file:/e:/zed/yotta.txt" , "file:///e:/zed/yotta.txt" ));
10931093 args .add (Arguments .of ("jar:file:///E:/path/to/bar.jar" , "jar:file:///E:/path/to/bar.jar" ));
1094- args .add (Arguments .of ("jar:file:///E:/path/to/bar.jar" , "jar:file:///E:/path/to/bar.jar" ));
1094+ // URI format (bad scheme case, but we preserve it)
1095+ args .add (Arguments .of ("JAR:FILE:///E:/path/to/bar.jar" , "JAR:FILE:///E:/path/to/bar.jar" ));
10951096 }
10961097 else
10971098 {
@@ -1101,8 +1102,13 @@ public static Stream<Arguments> toURICases()
11011102 }
11021103 // URI format (absolute)
11031104 args .add (Arguments .of ("file:///path/to/zed.jar" , "file:///path/to/zed.jar" ));
1105+ args .add (Arguments .of ("FILE:///path/to/zed.jar" , "file:///path/to/zed.jar" ));
11041106 args .add (Arguments .of ("jar:file:///path/to/bar.jar" , "jar:file:///path/to/bar.jar" ));
1105-
1107+ // URI format (bad scheme case, but we preserve it)
1108+ args .add (Arguments .of ("JAR:FILE:///path/to/bar.jar" , "JAR:FILE:///path/to/bar.jar" ));
1109+ // URI format (bad URL syntax)
1110+ args .add (Arguments .of ("file:/path/to/bad.jar" , "file:///path/to/bad.jar" ));
1111+ args .add (Arguments .of ("jar:file:/path/to/bad.jar!/" , "jar:file:///path/to/bad.jar!/" ));
11061112 return args .stream ();
11071113 }
11081114
You can’t perform that action at this time.
0 commit comments