Gerasimos (Makis) Maropoulos 2022-08-27 00:22:42 +03:00
parent 9821cbe6d8
commit 3c474097c6
No known key found for this signature in database
GPG Key ID: 403EEB7885C79503

View File

@ -1012,6 +1012,10 @@ var GetDomain = func(hostport string) string {
// loopback.
return "localhost"
default:
if net.ParseIP(host) != nil { // if it's an IP, see #1945.
return host
}
if domain, err := publicsuffix.EffectiveTLDPlusOne(host); err == nil {
host = domain
}