mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Remove dead code from test
This commit is contained in:
@@ -32,36 +32,9 @@ public class RequestForgery2 extends HttpServlet {
|
||||
try {
|
||||
|
||||
String sink = request.getParameter("uri");
|
||||
// URI(String str)
|
||||
URI uri = new URI(sink);
|
||||
|
||||
// URI(String scheme, String ssp, String fragment)
|
||||
URI uri2 = new URI("http", sink, "fragement");
|
||||
|
||||
// URI(String scheme, String userInfo, String host, int port, String path,
|
||||
// String query, String fragment)
|
||||
URI uri3 = new URI("http", "userinfo", "host", 1, "path", "query", "fragment");
|
||||
// URI(String scheme, String host, String path, String fragment)
|
||||
URI uri4 = new URI("http", "host", "path", "fragment");
|
||||
// URI(String scheme, String authority, String path, String query, String
|
||||
// fragment)
|
||||
URI uri5 = new URI("http", "authority", "path", "query", "fragment");
|
||||
URI uri6 = URI.create("http://foo.com/");
|
||||
|
||||
// URL(String spec)
|
||||
URL url1 = new URL(sink);
|
||||
// URL(String protocol, String host, int port, String file)
|
||||
URL url2 = new URL("http", "host", 1, "file");
|
||||
// URL(String protocol, String host, String file)
|
||||
URL url3 = new URL("http", "host", "file");
|
||||
// URL(URL context, String spec)
|
||||
URL url4 = new URL(url3, "http");
|
||||
// URL(String protocol, String host, int port, String file, URLStreamHandler
|
||||
// handler)
|
||||
URL url5 = new URL("http", "host", 1, "file", new Helper2());
|
||||
|
||||
// URL(URL context, String spec, URLStreamHandler handler)
|
||||
URL url6 = new URL(url3, "spec", new Helper2());
|
||||
|
||||
URLConnection c1 = url1.openConnection(); // $ SSRF
|
||||
SocketAddress sa = new SocketAddress() {
|
||||
@@ -110,13 +83,3 @@ public class RequestForgery2 extends HttpServlet {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Helper2 extends URLStreamHandler {
|
||||
Helper2() {
|
||||
}
|
||||
|
||||
protected URLConnection openConnection(URL u) throws IOException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user