fix(GatewaySecurityFilter.java): 线上环境限制请求路径判断错误问题修复

This commit is contained in:
郝先瑞 2022-06-15 00:51:41 +08:00
parent a09996080d
commit fc5bba4b3d

View File

@ -60,9 +60,9 @@ public class GatewaySecurityFilter implements GlobalFilter, Ordered {
if (!isPermitPath) {
return ResponseUtils.writeErrorInfo(response, ResultCode.FORBIDDEN_OPERATION);
}
} else {
} else if(methodValue.equals("POST")){
// 是否禁止放行的请求路径
boolean isForbidPath = SecurityConstants.PROD_FORBID_PATHS.stream().anyMatch(permitPath -> requestPath.contains(permitPath));
boolean isForbidPath = SecurityConstants.PROD_FORBID_PATHS.stream().anyMatch(permitPath -> requestPath.equals(permitPath));
if (isForbidPath) {
return ResponseUtils.writeErrorInfo(response, ResultCode.FORBIDDEN_OPERATION);
}