You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shenyu.apache.org by GitBox <gi...@apache.org> on 2021/06/21 15:27:12 UTC

[GitHub] [incubator-shenyu] MarsOu1995 commented on a change in pull request #1656: feature shenyu-common: IpUtils Add parameters to select the network ip .

MarsOu1995 commented on a change in pull request #1656:
URL: https://github.com/apache/incubator-shenyu/pull/1656#discussion_r655483858



##########
File path: shenyu-common/src/main/java/org/apache/shenyu/common/utils/IpUtils.java
##########
@@ -44,11 +56,25 @@ public static String getHost() {
                     InetAddress inetAddress = (InetAddress) addresses.nextElement();
                     String hostAddress = inetAddress.getHostAddress();
                     if (hostAddress.contains(".") && !inetAddress.isLoopbackAddress()) {
-                        hostIp = hostAddress;
-                        break;
+                        if (first) {
+                            firstHostIp = hostAddress;
+                            first = false;

Review comment:
       Yes it would be better 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org