mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-18 07:32:42 +01:00
net: Fix issue where some local clients would break.
Ran into this on Windows, when it didn't return "localhost" as a possible name for 127.0.0.1 or ::1.
This commit is contained in:
parent
985f87d9d1
commit
3c2fae666a
@ -24,7 +24,7 @@ func AddrLookupHostname(addr net.Addr) string {
|
|||||||
|
|
||||||
func LookupHostname(addr string) string {
|
func LookupHostname(addr string) string {
|
||||||
names, err := net.LookupAddr(addr)
|
names, err := net.LookupAddr(addr)
|
||||||
if err != nil || !IsHostname(names[0]) {
|
if err != nil || len(names) < 1 || !IsHostname(names[0]) {
|
||||||
// return original address
|
// return original address
|
||||||
return addr
|
return addr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user