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:
7
http.go
7
http.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user