From 155eb55953450e3076b4bb3ed506c0169a22c82a Mon Sep 17 00:00:00 2001 From: runphp Date: Fri, 11 Feb 2022 06:15:39 +0000 Subject: [PATCH] The 'filter().findAny().isPresent()' chain can be replaced with 'anyMatch()' --- .../src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java index 9deab70..ec7801b 100644 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java +++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/BlackListUrlFilter.java @@ -44,7 +44,7 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory p.matcher(url).find()).findAny().isPresent(); + return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find()); } public List getBlacklistUrl()