mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +08:00
fix: fix gin context zero
This commit is contained in:
parent
0d9dbbb445
commit
3cf686cd7e
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user