update SqlFilterArgumentResolver.java.

This commit is contained in:
Hacker 2022-02-15 07:11:01 +00:00 committed by Gitee
parent 70b6e08e41
commit fbfae70d41
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -102,14 +102,7 @@ public class SqlFilterArgumentResolver implements HandlerMethodArgumentResolver
* @return Predicate
*/
private Predicate<String> sqlInjectPredicate() {
return sql -> {
for (String keyword : KEYWORDS) {
if (StrUtil.containsIgnoreCase(sql, keyword)) {
return false;
}
}
return true;
};
return sql -> Arrays.stream(KEYWORDS).noneMatch(keyword -> StrUtil.containsIgnoreCase(sql, keyword));
}
}