1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

rewrite middleware: add PrimarySubdomain and simplify its usage example

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-20 03:05:47 +03:00
parent 12737c5b7f
commit ffae9c0d09
6 changed files with 167 additions and 111 deletions

View File

@@ -889,7 +889,8 @@ func GetDomain(hostport string) string {
}
switch host {
case "127.0.0.1", "0.0.0.0", "::1", "[::1]", "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0:1":
// We could use the netutil.LoopbackRegex but leave it as it's for now, it's faster.
case "localhost", "127.0.0.1", "0.0.0.0", "::1", "[::1]", "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0:1":
// loopback.
return "localhost"
default: