3
0
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:
Jeremy Latt 2014-02-09 15:14:53 -08:00
parent 133b91b9f0
commit 6653b55416

View File

@ -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