适配路径是否存在 斜杆结尾

This commit is contained in:
TwelveT 2022-05-19 08:56:35 +00:00 committed by Gitee
parent 2a6a74ead5
commit 4ae09f3793
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,11 @@ public class AuthFilter implements GlobalFilter, Ordered
ServerHttpRequest.Builder mutate = request.mutate();
String url = request.getURI().getPath();
if (url.endsWith("/")) {
url = url.substring(0, url.length() - 1);
}
// 跳过不需要验证的路径
if (StringUtils.matches(url, ignoreWhite.getWhites()))
{