diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-02-11 16:46:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-11 16:46:03 +0800 |
commit | 245ac321c3169babe70a700108ea91fe5149c326 (patch) | |
tree | 52e2e66d1b69df7b3d72d1d0169f965cece100c4 /routers/install/install.go | |
parent | e9b98aef447686f918ce4922ccadfed54c3f1634 (diff) | |
download | gitea-245ac321c3169babe70a700108ea91fe5149c326.tar.gz gitea-245ac321c3169babe70a700108ea91fe5149c326.zip |
Fix context usage (#33554)
Some old code use direct type-casting to get context, it causes
problems.
This PR fixes all legacy problems and use correct `ctx.Value` to get
low-level contexts.
Fix #33518
Diffstat (limited to 'routers/install/install.go')
-rw-r--r-- | routers/install/install.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install/install.go b/routers/install/install.go index 8a1d57aa0b..2cede3685d 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -64,7 +64,7 @@ func Contexter() func(next http.Handler) http.Handler { return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { base := context.NewBaseContext(resp, req) ctx := context.NewWebContext(base, rnd, session.GetSession(req)) - ctx.SetContextValue(context.WebContextKey, ctx) + ctx.SetContextValue(context.WebContextKey, ctx) // FIXME: this should be removed because NewWebContext should already set it ctx.Data.MergeFrom(middleware.CommonTemplateContextData()) ctx.Data.MergeFrom(reqctx.ContextData{ "Title": ctx.Locale.Tr("install.install"), |