We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 571e0c3 commit e35f30eCopy full SHA for e35f30e
src/main/java/org/joychou/controller/URLWhiteList.java
@@ -77,6 +77,18 @@ public String regex(HttpServletRequest request) throws Exception{
77
}
78
79
80
+ @RequestMapping("/indexof")
81
+ @ResponseBody
82
+ public String indexOf(HttpServletRequest request) throws Exception{
83
+ String url = request.getParameter("url");
84
+ // indexof返回-1,表示没有匹配到字符串
85
+ if (-1 == url.indexOf(urlwhitelist)) {
86
+ return "URL is illegal";
87
+ } else {
88
+ return "URL is legal";
89
+ }
90
91
+
92
// 安全代码
93
@RequestMapping("/seccode")
94
@ResponseBody
0 commit comments