Browse Source

直接获取IP地址而不是获取host

zhou-hao 4 years ago
parent
commit
64ad82275a

+ 1 - 1
hsweb-core/src/main/java/org/hswebframework/web/utils/ReactiveWebUtils.java

@@ -30,7 +30,7 @@ public class ReactiveWebUtils {
             }
         }
         return Optional.ofNullable(request.getRemoteAddress())
-                .map(InetSocketAddress::getHostName)
+                .map(addr->addr.getAddress().getHostAddress())
                 .orElse("unknown");
     }