mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
return a valid URL struct from sanitizeURL() pass the URL struct above to sanitizeBindAddr() Since url.Parse() will return an error when parsing an already-parsed ipv6 url string, (e.g. [http://[fe80::6203:8ff:fe9e:ace%25eth0]:7001), so I just return the valid URL struct from sanitizeURL() and send it to sanitizeBindAddr(), then there is no need to parse it again in sanitizeBindAddr(). Besides, for IPV6 url, the percent sign should be escaped, see: http://en.wikipedia.org/wiki/IPv6_address#Link-local_addresses_and_zone_indices