mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
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
This commit is contained in:
@@ -156,7 +156,7 @@ func PackageContexter() func(next http.Handler) http.Handler {
|
||||
base := NewBaseContext(resp, req)
|
||||
// it is still needed when rendering 500 page in a package handler
|
||||
ctx := NewWebContext(base, renderer, nil)
|
||||
ctx.SetContextValue(WebContextKey, ctx)
|
||||
ctx.SetContextValue(WebContextKey, ctx) // FIXME: this should be removed because NewWebContext should already set it
|
||||
next.ServeHTTP(ctx.Resp, ctx.Req)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user