make fix
Showing
2 changed files
with
6 additions
and
5 deletions
| ... | @@ -4,6 +4,7 @@ import ( | ... | @@ -4,6 +4,7 @@ import ( |
| 4 | "net/http" | 4 | "net/http" |
| 5 | "path" | 5 | "path" |
| 6 | "path/filepath" | 6 | "path/filepath" |
| 7 | "strconv" | ||
| 7 | "strings" | 8 | "strings" |
| 8 | 9 | ||
| 9 | "github.com/astaxie/beego/middleware" | 10 | "github.com/astaxie/beego/middleware" |
| ... | @@ -194,13 +195,13 @@ func Run() { | ... | @@ -194,13 +195,13 @@ func Run() { |
| 194 | sessionConfig := AppConfig.String("sessionConfig") | 195 | sessionConfig := AppConfig.String("sessionConfig") |
| 195 | if sessionConfig == "" { | 196 | if sessionConfig == "" { |
| 196 | sessionConfig = `{"cookieName":` + SessionName + `,` + | 197 | sessionConfig = `{"cookieName":` + SessionName + `,` + |
| 197 | `"gclifetime":` + SessionGCMaxLifetime + `,` + | 198 | `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` + |
| 198 | `"providerConfig":` + SessionSavePath + `,` + | 199 | `"providerConfig":` + SessionSavePath + `,` + |
| 199 | `"secure":` + HttpTLS + `,` + | 200 | `"secure":` + strconv.FormatBool(HttpTLS) + `,` + |
| 200 | `"sessionIDHashFunc":` + SessionHashFunc + `,` + | 201 | `"sessionIDHashFunc":` + SessionHashFunc + `,` + |
| 201 | `"sessionIDHashKey":` + SessionHashKey + `,` + | 202 | `"sessionIDHashKey":` + SessionHashKey + `,` + |
| 202 | `"enableSetCookie":` + SessionAutoSetCookie + `,` + | 203 | `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` + |
| 203 | `"cookieLifeTime":` + SessionCookieLifeTime + `,}` | 204 | `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `,}` |
| 204 | } | 205 | } |
| 205 | GlobalSessions, _ = session.NewManager(SessionProvider, | 206 | GlobalSessions, _ = session.NewManager(SessionProvider, |
| 206 | sessionConfig) | 207 | sessionConfig) | ... | ... |
| ... | @@ -529,7 +529,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) | ... | @@ -529,7 +529,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) |
| 529 | // session init | 529 | // session init |
| 530 | if SessionOn { | 530 | if SessionOn { |
| 531 | context.Input.CruSession = GlobalSessions.SessionStart(w, r) | 531 | context.Input.CruSession = GlobalSessions.SessionStart(w, r) |
| 532 | defer context.Input.CruSession.SessionRelease() | 532 | defer context.Input.CruSession.SessionRelease(w) |
| 533 | } | 533 | } |
| 534 | 534 | ||
| 535 | if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) { | 535 | if !utils.InSlice(strings.ToLower(r.Method), HTTPMETHOD) { | ... | ... |
-
Please register or sign in to post a comment