diff --git a/src/burp/Commons.java b/src/burp/Commons.java index f71e5d59..34296204 100644 --- a/src/burp/Commons.java +++ b/src/burp/Commons.java @@ -71,7 +71,7 @@ public static boolean isResponseNull(IHttpRequestResponse message){ */ public static boolean uselessExtension(String urlpath) { String extensions = "css|jpeg|gif|jpg|png|rar|zip|svg|jpeg|ico|woff|woff2|ttf|otf"; - String[] extList = extensions.split("|"); + String[] extList = extensions.split("\\|"); for ( String item:extList) { if(urlpath.endsWith("."+item)) { return true; @@ -721,8 +721,12 @@ public static void test7() { System.out.println(IPSet); System.out.println(CDNSet); } + + public static void test8() { + System.out.println(uselessExtension("abc.css")); + } public static void main(String args[]) { - test7(); + test8(); } } diff --git a/src/test/urltest.java b/src/test/urltest.java index d7a441ab..28a93ca2 100644 --- a/src/test/urltest.java +++ b/src/test/urltest.java @@ -11,13 +11,13 @@ public class urltest public static void main(String [] args) { //System.out.println(getFullUrlStringWithoutDefaultPort()); - test3(); + test(); } - public void test() { + public static void test() { try { - URL url = new URL("https://www.runoob.com/index.html?language=cn#j2se"); - URL url1 = new URL("https://www.runoob.com:443/index.html?language=cn#j2se"); + URL url = new URL("https://www.runoob.com/xxxx/index.html?language=cn#j2se"); + URL url1 = new URL("https://www.runoob.com:443/xxxx/index.html?language=cn#j2se"); System.out.println(url.equals(url1)); System.out.println("URL 为:" + url.toString()); System.out.println("协议为:" + url.getProtocol());