1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-22 03:15:58 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-01-04 19:50:54 +02:00
parent 058d70e533
commit 3b0a8e0f2d
5 changed files with 68 additions and 5 deletions

View File

@@ -200,7 +200,11 @@ func (ctx *Context) Method() string {
// Host returns the host part of the current url
func (ctx *Context) Host() string {
return ctx.Request.URL.Host
h := ctx.Request.URL.Host
if h == "" {
h = ctx.Request.Host
}
return h
}
// ServerHost returns the server host taken by *http.Request.Host