fix url host is empty when !edge on sessions subdomains persistence

Former-commit-id: 335a4f252e387d939b2cf9311e3acc8b35a41ce9
This commit is contained in:
Gerasimos (Makis) Maropoulos 2017-09-21 12:31:54 +03:00
parent e3563cff59
commit 9ff124d39f

View File

@ -46,7 +46,7 @@ func (s *Sessions) updateCookie(ctx context.Context, sid string, expires time.Du
cookie.Path = "/" cookie.Path = "/"
if !s.config.DisableSubdomainPersistence { if !s.config.DisableSubdomainPersistence {
requestDomain := ctx.Request().URL.Host requestDomain := ctx.Host()
if portIdx := strings.IndexByte(requestDomain, ':'); portIdx > 0 { if portIdx := strings.IndexByte(requestDomain, ':'); portIdx > 0 {
requestDomain = requestDomain[0:portIdx] requestDomain = requestDomain[0:portIdx]
} }