loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix incorrect cookie path for AppSubURL (#29534)

Regression of #24107

(cherry picked from commit 44398e405ffe297997c6b9c8dbb97f966926b65a)

authored by

wxiaoguang and committed by
Earl Warren
ff7a032c 318634ef

+6 -2
+5 -2
modules/setting/session.go
··· 21 21 ProviderConfig string 22 22 // Cookie name to save session ID. Default is "MacaronSession". 23 23 CookieName string 24 - // Cookie path to store. Default is "/". HINT: there was a bug, the old value doesn't have trailing slash, and could be empty "". 24 + // Cookie path to store. Default is "/". 25 25 CookiePath string 26 26 // GC interval time in seconds. Default is 3600. 27 27 Gclifetime int64 ··· 49 49 SessionConfig.ProviderConfig = path.Join(AppWorkPath, SessionConfig.ProviderConfig) 50 50 } 51 51 SessionConfig.CookieName = sec.Key("COOKIE_NAME").MustString("i_like_gitea") 52 - SessionConfig.CookiePath = AppSubURL + "/" // there was a bug, old code only set CookePath=AppSubURL, no trailing slash 52 + SessionConfig.CookiePath = AppSubURL 53 + if SessionConfig.CookiePath == "" { 54 + SessionConfig.CookiePath = "/" 55 + } 53 56 SessionConfig.Secure = sec.Key("COOKIE_SECURE").MustBool(strings.HasPrefix(strings.ToLower(AppURL), "https://")) 54 57 SessionConfig.Gclifetime = sec.Key("GC_INTERVAL_TIME").MustInt64(86400) 55 58 SessionConfig.Maxlifetime = sec.Key("SESSION_LIFE_TIME").MustInt64(86400)
+1
routers/common/middleware.go
··· 38 38 }) 39 39 }) 40 40 41 + // wrap the request and response, use the process context and add it to the process manager 41 42 handlers = append(handlers, func(next http.Handler) http.Handler { 42 43 return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { 43 44 ctx, _, finished := process.GetManager().AddTypedContext(req.Context(), fmt.Sprintf("%s: %s", req.Method, req.RequestURI), process.RequestProcessType, true)