diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLAddress.java b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLAddress.java index dd88b64ff60..82276bc31bb 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLAddress.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/URLAddress.java @@ -24,6 +24,8 @@ import java.net.URLDecoder; import java.util.Objects; +import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR; + public class URLAddress implements Serializable { private static final long serialVersionUID = -1985165475234910535L; @@ -168,7 +170,7 @@ public static URLAddress parse(String rawAddress, String defaultProtocol, boolea decodeStr = URLDecoder.decode(rawAddress, "UTF-8"); } - boolean isPathAddress = !Character.isDigit(decodeStr.charAt(0)); + boolean isPathAddress = decodeStr.contains(PATH_SEPARATOR); if (isPathAddress) { return createPathURLAddress(decodeStr, rawAddress, defaultProtocol); }