mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
interpret local ips as localhost
This commit is contained in:
parent
133b91b9f0
commit
6653b55416
@ -71,6 +71,10 @@ func LookupHostname(addr net.Addr) string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return addrStr
|
return addrStr
|
||||||
}
|
}
|
||||||
|
switch ipaddr {
|
||||||
|
case "127.0.0.1", "::1":
|
||||||
|
return "localhost"
|
||||||
|
}
|
||||||
names, err := net.LookupHost(ipaddr)
|
names, err := net.LookupHost(ipaddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ipaddr
|
return ipaddr
|
||||||
|
Loading…
Reference in New Issue
Block a user