helpta commented on a change in pull request #2077: 解析用户定义的URL时,当前太过粗暴,做下优雅调整
URL: https://github.com/apache/incubator-dubbo/pull/2077#discussion_r208079057
##########
File path:
dubbo-common/src/main/java/org/apache/dubbo/common/utils/UrlUtils.java
##########
@@ -27,14 +27,19 @@
public class UrlUtils {
+ /**
+ * in the url string,mark the param begin
+ */
+ private final static String URL_PARAM_STARTING_SYMBOL = "?";
+
public static URL parseURL(String address, Map<String, String> defaults) {
if (address == null || address.length() == 0) {
return null;
}
String url;
- if (address.indexOf("://") >= 0) {
+ if (address.contains("://") ||
address.contains(URL_PARAM_STARTING_SYMBOL)) {
url = address;
- } else {
+ }else {
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]