From 3cf686cd7e50a68cb31e10b8aaa152dbbc381b88 Mon Sep 17 00:00:00 2001 From: FarmerChillax Date: Wed, 20 Mar 2024 20:52:08 +0800 Subject: [PATCH] fix: fix gin context zero --- context.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/context.go b/context.go index 0c73a49f..ad277394 100644 --- a/context.go +++ b/context.go @@ -1226,6 +1226,10 @@ func (c *Context) Err() error { // the same key returns the same result. func (c *Context) Value(key any) any { if key == 0 { + val := c.Request.Context().Value(key) + if val != nil { + return val + } return c.Request } if key == ContextKey {