Former-commit-id: 3aa98f18efb2f4fbdd6f55ac883e9747236c7e40
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-07-22 11:29:45 +03:00
parent 090c448472
commit cc26f3eeed

View File

@ -159,12 +159,14 @@ func ResolveVHost(addr string) string {
} }
if idx := strings.IndexByte(addr, ':'); idx == 0 { if idx := strings.IndexByte(addr, ':'); idx == 0 {
// only port, then return the localhost hostname // only port, then return the 0.0.0.0
return "localhost" + addr[idx:] return "0.0.0.0" + addr[idx:]
} }
// with ':' in order to not replace the ipv6 loopback addresses // with ':' in order to not replace the ipv6 loopback addresses
addr = strings.Replace(addr, "0.0.0.0:", "localhost:", 1) // addr = strings.Replace(addr, "0.0.0.0:", "localhost:", 1)
// some users are confusing from the log output ^.
port := ResolvePort(addr) port := ResolvePort(addr)
if port == 80 || port == 443 { if port == 80 || port == 443 {
return ResolveHostname(addr) return ResolveHostname(addr)