1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 20:07:04 +00:00

Rocket chat is on, Add Port() to the HTTPServer, disable subdomain persistence on subdomains when 127.0.0.1/0.0.0.0

I already made a test framework integration but I will commit this when
I finish with the basic tests, we are going to final v3
This commit is contained in:
Makis Maropoulos
2016-07-03 16:21:57 +02:00
parent c443dc9808
commit 0d4b0ecd43
5 changed files with 37 additions and 7 deletions

View File

@@ -101,10 +101,11 @@ func (m *Manager) Start(ctx context.IContext) store.IStore {
if portIdx := strings.IndexByte(requestDomain, ':'); portIdx > 0 {
requestDomain = requestDomain[0:portIdx]
}
if requestDomain == "0.0.0.0" || requestDomain == "127.0.0.1" {
// for these type of hosts, we can't allow subdomains persistance,
// the web browser doesn't understand the mysubdomain.0.0.0.0 and mysubdomain.127.0.0.1 as scorrectly ubdomains because of the many dots
cookie.SetDomain(requestDomain)
// so don't set a domain here
} else if strings.Count(requestDomain, ".") > 0 { // there is a problem with .localhost setted as the domain, so we check that first