forked from External/ergo
interpret local ips as localhost
This commit is contained in:
parent
133b91b9f0
commit
6653b55416
1 changed files with 4 additions and 0 deletions
|
|
@ -71,6 +71,10 @@ func LookupHostname(addr net.Addr) string {
|
|||
if err != nil {
|
||||
return addrStr
|
||||
}
|
||||
switch ipaddr {
|
||||
case "127.0.0.1", "::1":
|
||||
return "localhost"
|
||||
}
|
||||
names, err := net.LookupHost(ipaddr)
|
||||
if err != nil {
|
||||
return ipaddr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue