mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2025-01-04 01:52:21 +08:00
fix(GatewaySecurityFilter.java): 线上访问限制错误问题修复
This commit is contained in:
parent
3b2a207956
commit
ae4cf68644
@ -56,13 +56,13 @@ public class GatewaySecurityFilter implements GlobalFilter, Ordered {
|
||||
String methodValue = request.getMethodValue();
|
||||
if (SecurityConstants.PROD_FORBID_METHODS.contains(methodValue)) { // PUT和DELETE方法禁止
|
||||
// 是否需要放行的请求路径
|
||||
boolean isPermitPath = SecurityConstants.PROD_PERMIT_PATHS.stream().anyMatch(permitPath -> requestPath.contains(permitPath));
|
||||
boolean isPermitPath = SecurityConstants.PROD_PERMIT_PATHS.stream().anyMatch(permitPath -> permitPath.contains(requestPath));
|
||||
if (!isPermitPath) {
|
||||
return ResponseUtils.writeErrorInfo(response, ResultCode.FORBIDDEN_OPERATION);
|
||||
}
|
||||
} else {
|
||||
// 是否禁止放行的请求路径
|
||||
boolean isForbidPath = SecurityConstants.PROD_FORBID_PATHS.stream().anyMatch(permitPath -> requestPath.contains(permitPath));
|
||||
boolean isForbidPath = SecurityConstants.PROD_FORBID_PATHS.stream().anyMatch(permitPath -> permitPath.contains(requestPath));
|
||||
if (isForbidPath) {
|
||||
return ResponseUtils.writeErrorInfo(response, ResultCode.FORBIDDEN_OPERATION);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user