From 49c1a595ec6ebf4eadb3dc085075c3d8fb5d172a Mon Sep 17 00:00:00 2001 From: Makis Maropoulos Date: Thu, 30 Jun 2016 06:02:07 +0300 Subject: [PATCH] Remove unused context.Domain it was added (and wrong idx) on previous commit for some of my internal tests, this is not used anywhere so remove it. --- context.go | 9 --------- context/context.go | 1 - sessions/manager.go | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/context.go b/context.go index f34372bf..0a13250e 100644 --- a/context.go +++ b/context.go @@ -297,15 +297,6 @@ func (ctx *Context) PostFormMulti(name string) []string { return arrStr } -// Domain same as VirtualHostname but without the :port part (if any) -func (ctx *Context) Domain() string { - domain := ctx.VirtualHostname() - if idx := strings.IndexByte(domain, ':'); idx > 0 { - domain = domain[0 : idx-1] - } - return domain -} - // Subdomain returns the subdomain (string) of this request, if any func (ctx *Context) Subdomain() (subdomain string) { host := ctx.HostString() diff --git a/context/context.go b/context/context.go index 6900ce85..b155ac86 100644 --- a/context/context.go +++ b/context/context.go @@ -23,7 +23,6 @@ type ( URLParams() map[string]string MethodString() string HostString() string - Domain() string Subdomain() string PathString() string RequestPath(bool) string diff --git a/sessions/manager.go b/sessions/manager.go index ee219556..e509a374 100644 --- a/sessions/manager.go +++ b/sessions/manager.go @@ -94,7 +94,7 @@ func (m *Manager) Start(ctx context.IContext) store.IStore { cookie.SetValue(base64.URLEncoding.EncodeToString([]byte(sid))) cookie.SetPath("/") if !m.config.DisableSubdomainPersistance { - requestDomain := ctx.HostString() // we don't use the ctx.Domain because it gives the virtual domain, which is correct on some cases but not here. + requestDomain := ctx.HostString() if portIdx := strings.IndexByte(requestDomain, ':'); portIdx > 0 { requestDomain = requestDomain[0:portIdx]