-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
Hi!
I ran into a problem, when I tried to create HostName from unresolved ipv6 InetSocketAddress. Here is a snippet:
var address = InetSocketAddress.createUnresolved("::1", 8080);
var hostName = new HostName(address);
System.out.println("Is valid: " + hostName.isValid());
System.out.println("Host: " + hostName.getHost());
System.out.println("Port: " + hostName.getPort());
System.out.println("HostName as string: " + hostName.toNormalizedString());
Output:
Is valid: true
Host: ::1:8080
Port: null
HostName as string: [0:0:0:0:0:0:1:8080]
Apparently, HostName does not properly parse port in this case. However if I create address with:
new InetSocketAddress("::1", 8080), everything is fine and I get [0:0:0:0:0:0:0:1]:8080 as the result.
Metadata
Metadata
Assignees
Labels
No labels