修复AuthFilter白名单过滤匹配不精准

pull/23/MERGE
DokiYoloo 4 years ago committed by Gitee
parent ede8456ea0
commit 48cf4250b4

@ -477,10 +477,14 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
// 匹配前缀Pattern // 匹配前缀Pattern
result = remainingURI.contains(prefixPattern); result = remainingURI.contains(prefixPattern);
// 已经没有星号,直接返回 // 已经没有星号,判断长度是否符合,并返回
if (formerStarOffset == -1) if (formerStarOffset == -1)
{ {
return result; //清洗请求路径
if (remainingURI.endsWith("/")) {
remainingURI = remainingURI.substring(0, remainingURI.length() - 1);
}
return remainingURI.length() == prefixPattern.length();
} }
// 匹配失败,直接返回 // 匹配失败,直接返回

Loading…
Cancel
Save