zendwang
2022-07-04 765deae84d167ac40e962914a99b636fb70a3bd7
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
@@ -1,5 +1,7 @@
package com.ruoyi.common.filter;
import cn.hutool.extra.servlet.ServletUtil;
import com.ruoyi.common.enums.HttpMethod;
import com.ruoyi.common.utils.StringUtils;
import javax.servlet.*;
@@ -33,7 +35,7 @@
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        HttpServletResponse resp = (HttpServletResponse) response;
        if (handleExcludeURL(req, resp)) {
@@ -48,7 +50,7 @@
        String url = request.getServletPath();
        String method = request.getMethod();
        // GET DELETE 不过滤
        if (method == null || method.matches("GET") || method.matches("DELETE")) {
        if (method == null || method.matches(HttpMethod.GET.name()) || method.matches(HttpMethod.DELETE.name())) {
            return true;
        }
        return StringUtils.matches(url, excludes);