update 优化魔法值

This commit is contained in:
zendwang 2022-07-04 13:06:18 +08:00
parent 686068c8ed
commit 765deae84d
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +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.*;
@ -49,7 +50,7 @@ public class XssFilter implements Filter {
String url = request.getServletPath();
String method = request.getMethod();
// GET DELETE 不过滤
if (method == null || method.matches(ServletUtil.METHOD_GET) || method.matches(ServletUtil.METHOD_DELETE)) {
if (method == null || method.matches(HttpMethod.GET.name()) || method.matches(HttpMethod.DELETE.name())) {
return true;
}
return StringUtils.matches(url, excludes);

View File

@ -28,7 +28,7 @@ import java.util.Map;
@Slf4j
public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
public static final String PROD_PROFILE = "prod";
private static final String PROD_PROFILE = "prod";
private final TransmittableThreadLocal<StopWatch> invokeTimeTL = new TransmittableThreadLocal<>();