mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 12:31:58 +00:00
minor
This commit is contained in:
@@ -186,6 +186,13 @@ func ResolveVHost(addr string) string {
|
||||
if idx := strings.IndexByte(addr, ':'); idx == 0 {
|
||||
// only port, then return the 0.0.0.0
|
||||
return /* "0.0.0.0" */ "localhost" + addr[idx:]
|
||||
} else if idx > 0 { // if 0.0.0.0:80 let's just convert it to localhost.
|
||||
if addr[0:idx] == "0.0.0.0" {
|
||||
if addr[idx:] == ":80" {
|
||||
return "localhost"
|
||||
}
|
||||
return "localhost" + addr[idx:]
|
||||
}
|
||||
}
|
||||
|
||||
// with ':' in order to not replace the ipv6 loopback addresses
|
||||
|
||||
Reference in New Issue
Block a user