From 9f28ae55a29f86d7185443ab6530e3eff2961562 Mon Sep 17 00:00:00 2001 From: forachange <7598945+forachange@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:22:48 +0800 Subject: [PATCH] Update StringUtils.java (#10936) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit method startsWith, 当 ignoreCase 为 true 时,lowerCasePrefix 值不正确 --- .../main/java/com/alibaba/nacos/common/utils/StringUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java b/common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java index 1f914be5b..1617aa2db 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/StringUtils.java @@ -400,7 +400,7 @@ public class StringUtils { } if (ignoreCase) { String lowerCaseStr = str.toString().toLowerCase(); - String lowerCasePrefix = str.toString().toLowerCase(); + String lowerCasePrefix = prefix.toString().toLowerCase(); return lowerCaseStr.startsWith(lowerCasePrefix); } else { return str.toString().startsWith(prefix.toString());