mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
Former-commit-id: 3aa98f18efb2f4fbdd6f55ac883e9747236c7e40
This commit is contained in:
parent
090c448472
commit
cc26f3eeed
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user