mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 20:00:54 +00:00
make fix
This commit is contained in:
parent
9cbd475701
commit
31bdb793cf
9
beego.go
9
beego.go
@ -4,6 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/astaxie/beego/middleware"
|
"github.com/astaxie/beego/middleware"
|
||||||
@ -194,13 +195,13 @@ func Run() {
|
|||||||
sessionConfig := AppConfig.String("sessionConfig")
|
sessionConfig := AppConfig.String("sessionConfig")
|
||||||
if sessionConfig == "" {
|
if sessionConfig == "" {
|
||||||
sessionConfig = `{"cookieName":` + SessionName + `,` +
|
sessionConfig = `{"cookieName":` + SessionName + `,` +
|
||||||
`"gclifetime":` + SessionGCMaxLifetime + `,` +
|
`"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` +
|
||||||
`"providerConfig":` + SessionSavePath + `,` +
|
`"providerConfig":` + SessionSavePath + `,` +
|
||||||
`"secure":` + HttpTLS + `,` +
|
`"secure":` + strconv.FormatBool(HttpTLS) + `,` +
|
||||||
`"sessionIDHashFunc":` + SessionHashFunc + `,` +
|
`"sessionIDHashFunc":` + SessionHashFunc + `,` +
|
||||||
`"sessionIDHashKey":` + SessionHashKey + `,` +
|
`"sessionIDHashKey":` + SessionHashKey + `,` +
|
||||||
`"enableSetCookie":` + SessionAutoSetCookie + `,` +
|
`"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` +
|
||||||
`"cookieLifeTime":` + SessionCookieLifeTime + `,}`
|
`"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `,}`
|
||||||
}
|
}
|
||||||
GlobalSessions, _ = session.NewManager(SessionProvider,
|
GlobalSessions, _ = session.NewManager(SessionProvider,
|
||||||
sessionConfig)
|
sessionConfig)
|
||||||
|
@ -529,7 +529,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
// session init
|
// session init
|
||||||
if SessionOn {
|
if SessionOn {
|
||||||
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
||||||
defer context.Input.CruSession.SessionRelease()
|
defer context.Input.CruSession.SessionRelease(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) {
|
if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) {
|
||||||
|
Loading…
Reference in New Issue
Block a user