From 3c474097c64df7bf91a1576c04e51603d8e6a4e9 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sat, 27 Aug 2022 00:22:42 +0300 Subject: [PATCH] https://github.com/kataras/iris/issues/1945#issuecomment-1226678256 --- context/context.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/context/context.go b/context/context.go index 08f56f71..2882ae3b 100644 --- a/context/context.go +++ b/context/context.go @@ -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 }