liubao68 commented on a change in pull request #651: [SCB-498] Configuration Center ip address need to config default port URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/651#discussion_r182670564
########## File path: foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/net/NetUtils.java ########## @@ -145,12 +145,25 @@ public static IpPort parseIpPortFromURI(String uriAddress) { try { URI uri = new URI(uriAddress); String authority = uri.getAuthority(); - return parseIpPort(authority); + return parseIpPort(uri.getScheme(), authority); } catch (URISyntaxException e) { return null; } } + private static IpPort parseIpPort(String scheme, String authority) { + if (authority == null) + return null; + int idx = authority.indexOf(':'); + if (idx != -1) + return parseIpPort(authority); + if (scheme.equals("http")) + return parseIpPort(new StringBuffer(authority).append(":80").toString()); Review comment: return new IpPort(authority, 80) ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services