diff options
Diffstat (limited to 'services/context/base.go')
-rw-r--r-- | services/context/base.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/context/base.go b/services/context/base.go index 68619bf067..d627095584 100644 --- a/services/context/base.go +++ b/services/context/base.go @@ -30,6 +30,10 @@ type contextValuePair struct { valueFn func() any } +type BaseContextKeyType struct{} + +var BaseContextKey BaseContextKeyType + type Base struct { originCtx context.Context contextValues []contextValuePair @@ -315,6 +319,7 @@ func NewBaseContext(resp http.ResponseWriter, req *http.Request) (b *Base, close Data: middleware.GetContextData(req.Context()), } b.Req = b.Req.WithContext(b) + b.AppendContextValue(BaseContextKey, b) b.AppendContextValue(translation.ContextKey, b.Locale) b.AppendContextValue(httplib.RequestContextKey, b.Req) return b, b.cleanUp |