mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 03:56:27 +01:00
parent
1079bb8f8b
commit
c32dd0d95c
|
@ -1947,11 +1947,16 @@ func (ctx *context) GetDomain() string {
|
||||||
host = host[0:portIdx]
|
host = host[0:portIdx]
|
||||||
}
|
}
|
||||||
|
|
||||||
if domain, err := publicsuffix.EffectiveTLDPlusOne(host); err == nil {
|
switch host {
|
||||||
host = domain
|
case "127.0.0.1", "0.0.0.0", "::1", "[::1]", "0:0:0:0:0:0:0", "0:0:0:0:0:0:1":
|
||||||
}
|
return "localhost"
|
||||||
|
default:
|
||||||
|
if domain, err := publicsuffix.EffectiveTLDPlusOne(host); err == nil {
|
||||||
|
host = domain
|
||||||
|
}
|
||||||
|
|
||||||
return host
|
return host
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsAjax returns true if this request is an 'ajax request'( XMLHttpRequest)
|
// IsAjax returns true if this request is an 'ajax request'( XMLHttpRequest)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user