mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
This commit is contained in:
@@ -785,12 +785,11 @@ func (ctx *Context) Host() string {
|
||||
|
||||
// GetHost returns the host part of the current URI.
|
||||
func GetHost(r *http.Request) string {
|
||||
if host := r.Host; host != "" {
|
||||
// contains subdomain.
|
||||
if host := r.URL.Host; host != "" {
|
||||
return host
|
||||
}
|
||||
|
||||
// contains subdomain.
|
||||
return r.URL.Host
|
||||
return r.Host
|
||||
}
|
||||
|
||||
// Subdomain returns the subdomain of this request, if any.
|
||||
|
||||
Reference in New Issue
Block a user