1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-14 14:18:41 +03:00
parent 9f0872719f
commit d0d7679a98
3 changed files with 3 additions and 5 deletions

View File

@@ -38,12 +38,11 @@ var IsLoopbackSubdomain = func(s string) bool {
// GetLoopbackSubdomain returns the part of the loopback subdomain.
func GetLoopbackSubdomain(s string) string {
if strings.HasPrefix(s, "127.0.0.1:") || s == "127.0.0.1" ||
strings.HasPrefix(s, "0.0.0.0:") || s == "0.0.0.0" /* let's resolve that without regex (see below)*/ {
strings.HasPrefix(s, "0.0.0.0:") || s == "0.0.0.0" {
return s
}
ss := loopbackSubRegex.FindString(s)
return ss
return loopbackSubRegex.FindString(s)
}
// IsLoopbackHost tries to catch the local addresses when a developer