Clean up getHostAndPort()

It now does more validation, and handles unescaped IPv6 addresses
better.
1 file changed