xss过滤时,不需要有contextPath路径
This commit is contained in:
parent
b9a77fc3a4
commit
6533791200
|
@ -38,7 +38,7 @@ public class XssFilter extends OncePerRequestFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 放行不过滤的URL
|
// 放行不过滤的URL
|
||||||
return properties.getExcludeUrls().stream().anyMatch(excludeUrl -> pathMatcher.match(excludeUrl, request.getRequestURI()));
|
return properties.getExcludeUrls().stream().anyMatch(excludeUrl -> pathMatcher.match(excludeUrl, request.getServletPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class XssFilterJsonDeserializer extends JsonDeserializer<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断该URI是否放行
|
// 判断该URI是否放行
|
||||||
boolean flag = properties.getExcludeUrls().stream().anyMatch(excludeUrl -> pathMatcher.match(excludeUrl, request.getRequestURI()));
|
boolean flag = properties.getExcludeUrls().stream().anyMatch(excludeUrl -> pathMatcher.match(excludeUrl, request.getServletPath()));
|
||||||
if (flag) {
|
if (flag) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user