Browse Source

update ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java.

update 优化 XssFilter 使用枚举替换字符串
master
光速蜗牛 2 years ago committed by Gitee
parent
commit
5b8cf9701f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 2
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java

2
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/XssFilter.java

@ -44,7 +44,7 @@ public class XssFilter implements GlobalFilter, Ordered
ServerHttpRequest request = exchange.getRequest(); ServerHttpRequest request = exchange.getRequest();
// GET DELETE 不过滤 // GET DELETE 不过滤
HttpMethod method = request.getMethod(); HttpMethod method = request.getMethod();
if (method == null || method.matches("GET") || method.matches("DELETE")) if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE)
{ {
return chain.filter(exchange); return chain.filter(exchange);
} }

Loading…
Cancel
Save