1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-05 03:07:38 +00:00

Fix CookieNeverExpires time, set an option for -1 for browser-based session (when browser closes cookie is removed)

This commit is contained in:
Gerasimos Maropoulos
2016-07-26 21:26:54 +03:00
parent c26ce245c7
commit 8288161b30
3 changed files with 12 additions and 8 deletions

View File

@@ -343,14 +343,15 @@ func (s *Server) FullHost() string {
// Hostname returns the hostname part of the host (host expect port)
func (s *Server) Hostname() string {
idxPort := strings.IndexByte(s.Host(), ':')
a := s.Host()
idxPort := strings.IndexByte(a, ':')
if idxPort > 0 {
// port exists, (it always exists for Config.ListeningAddr
return s.Host()[0:idxPort] // except the port
return a[0:idxPort] // except the port
} // but for Config.VListeningAddr the developer maybe doesn't uses the host:port format
// so, if no port found, then return the Host as it is, it should be something 'mydomain.com'
return s.Host()
return a
}
func (s *Server) listen() error {