fix: fix gin context zero

This commit is contained in:
FarmerChillax 2024-03-20 20:52:08 +08:00
parent 0d9dbbb445
commit 3cf686cd7e

View File

@ -1226,6 +1226,10 @@ func (c *Context) Err() error {
// the same key returns the same result. // the same key returns the same result.
func (c *Context) Value(key any) any { func (c *Context) Value(key any) any {
if key == 0 { if key == 0 {
val := c.Request.Context().Value(key)
if val != nil {
return val
}
return c.Request return c.Request
} }
if key == ContextKey { if key == ContextKey {