mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +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.
|
// 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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user