httpserver: Fix address display and routing for IPv6 IPs/wildcards

This commit is contained in:
Matthew Holt
2019-02-02 14:28:08 -07:00
parent 8369a12115
commit f2491580e0
2 changed files with 9 additions and 3 deletions

View File

@@ -428,11 +428,12 @@ func (a Address) String() string {
if s != "" {
s += "://"
}
s += a.Host
if a.Port != "" &&
((scheme == "https" && a.Port != DefaultHTTPSPort) ||
(scheme == "http" && a.Port != DefaultHTTPPort)) {
s += ":" + a.Port
s += net.JoinHostPort(a.Host, a.Port)
} else {
s += a.Host
}
if a.Path != "" {
s += a.Path