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