-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
area/dashboardIssues or PRs about Sentinel DashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomersGood for newcomers
Description
Issue Description
Type: bug report or feature request
Describe what happened (or what feature you want)
url只能精准匹配
if(authFilterExcludeUrls.contains(servletPath)) {
chain.doFilter(request, response);
return;
}
Describe what you expected to happen
// Exclude the urls which needn't auth
for (String authFilterExcludeUrl : authFilterExcludeUrls) {
if (isMatch(authFilterExcludeUrl, servletPath)) {
chain.doFilter(request, response);
return;
}
}
// 判断url是否与规则配置: ? 表示单个字符; * 表示一层路径内的任意字符串,不可跨层级; ** 表示任意层路径;
public Boolean isMatch(String pattern, String url) {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
}
private static final AntPathMatcher PATH_MATCHER = new AntPathMatcher();
if (authFilterExcludeUrls.stream().anyMatch(s -> PATH_MATCHER.match(s, servletPath))) {
chain.doFilter(request, response);
return;
}
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
master
Anything else we need to know?
Metadata
Metadata
Assignees
Labels
area/dashboardIssues or PRs about Sentinel DashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomersGood for newcomers