Skip to content

Commit 06f987a

Browse files
committed
Java: Add test example of a supported sink defined in QL.
1 parent 13ff941 commit 06f987a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

java/ql/test/query-tests/Telemetry/SupportedExternalApis/SupportedExternalApis.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import java.io.File;
2+
import java.io.FileWriter;
3+
import java.io.InputStream;
4+
import java.io.IOException;
5+
import java.net.URL;
16
import java.time.Duration;
27
import java.util.HashMap;
38
import java.util.Map;
4-
import java.io.InputStream;
5-
import java.net.URL;
6-
import java.io.File;
7-
import java.io.FileWriter;
9+
import javax.servlet.http.HttpServletResponse;
10+
import javax.servlet.ServletException;
811
import org.apache.commons.io.FileUtils;
912

1013
class SupportedExternalApis {
@@ -30,4 +33,8 @@ public static void main(String[] args) throws Exception {
3033

3134
file.compareTo(file); // supported neutral sink (compareTo)
3235
}
36+
37+
public static void doSendRedirect(HttpServletResponse req) throws ServletException, IOException {
38+
req.sendRedirect("myredirect"); // supported sink (sendRedirect)
39+
}
3340
}

0 commit comments

Comments
 (0)