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.
This commit is contained in:
Makis Maropoulos 2016-06-30 06:02:07 +03:00
parent 66a66fdfa0
commit 49c1a595ec
3 changed files with 1 additions and 11 deletions

View File

@ -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()

View File

@ -23,7 +23,6 @@ type (
URLParams() map[string]string
MethodString() string
HostString() string
Domain() string
Subdomain() string
PathString() string
RequestPath(bool) string

View File

@ -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]