Fixes ipv6 formatting in specific scenario
Use getHostAddress() when getHostName() might return a host name which doesn't need brackets for formatting. Fixes gh-807
This commit is contained in:
@@ -55,7 +55,7 @@ public final class ConsulServerUtils {
|
||||
try {
|
||||
InetAddress inetAdr = InetAddress.getByName(address);
|
||||
if (inetAdr instanceof Inet6Address) {
|
||||
return "[" + inetAdr.getHostName() + "]";
|
||||
return "[" + inetAdr.getHostAddress() + "]";
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user