@@ -32,36 +32,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
3232 try {
3333
3434 String sink = request .getParameter ("uri" );
35- // URI(String str)
3635 URI uri = new URI (sink );
37-
38- // URI(String scheme, String ssp, String fragment)
3936 URI uri2 = new URI ("http" , sink , "fragement" );
40-
41- // URI(String scheme, String userInfo, String host, int port, String path,
42- // String query, String fragment)
43- URI uri3 = new URI ("http" , "userinfo" , "host" , 1 , "path" , "query" , "fragment" );
44- // URI(String scheme, String host, String path, String fragment)
45- URI uri4 = new URI ("http" , "host" , "path" , "fragment" );
46- // URI(String scheme, String authority, String path, String query, String
47- // fragment)
48- URI uri5 = new URI ("http" , "authority" , "path" , "query" , "fragment" );
49- URI uri6 = URI .create ("http://foo.com/" );
50-
51- // URL(String spec)
5237 URL url1 = new URL (sink );
53- // URL(String protocol, String host, int port, String file)
54- URL url2 = new URL ("http" , "host" , 1 , "file" );
55- // URL(String protocol, String host, String file)
56- URL url3 = new URL ("http" , "host" , "file" );
57- // URL(URL context, String spec)
58- URL url4 = new URL (url3 , "http" );
59- // URL(String protocol, String host, int port, String file, URLStreamHandler
60- // handler)
61- URL url5 = new URL ("http" , "host" , 1 , "file" , new Helper2 ());
62-
63- // URL(URL context, String spec, URLStreamHandler handler)
64- URL url6 = new URL (url3 , "spec" , new Helper2 ());
6538
6639 URLConnection c1 = url1 .openConnection (); // $ SSRF
6740 SocketAddress sa = new SocketAddress () {
@@ -110,13 +83,3 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
11083 }
11184 }
11285}
113-
114-
115- class Helper2 extends URLStreamHandler {
116- Helper2 () {
117- }
118-
119- protected URLConnection openConnection (URL u ) throws IOException {
120- return null ;
121- }
122- }
0 commit comments