smart-sso icon indicating copy to clipboard operation
smart-sso copied to clipboard

ClientFilter过滤问题

Open ls9527 opened this issue 7 years ago • 1 comments

可以把excludeList.contains(httpRequest.getServletPath()) 替换成下面的方式 这样的话,就可以使用/api/** 的方式过滤一组了,下面的代码参考spring-webmvc的 org.springframework.web.servlet.handler.MappedInterceptor#matches

private PathMatcher pathMatcher = new AntPathMatcher();

private boolean hasMatch(String path){
	for (String exclude : excludeList) {
		if(pathMatcher.match(exclude,path)){
			return true;
		}
	}
	return false;
}

ls9527 avatar May 23 '17 07:05 ls9527

非常棒的建议,👍

a466350665 avatar May 24 '17 00:05 a466350665