From 036d4a1b530b5d1b7a95d5a763064d479a59ba5c Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 30 May 2024 17:05:13 +0200 Subject: Cookie: Return the context without handle if no handle was given --- types/cookie/cookie.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/cookie/cookie.go b/types/cookie/cookie.go index 48c8dbf..e8fce93 100644 --- a/types/cookie/cookie.go +++ b/types/cookie/cookie.go @@ -91,5 +91,8 @@ func (c *Cookie) Send(data string) error { // Context gets the underlying context of the cookie func (c *Cookie) Context() context.Context { + if c.H == 0 { + return c.ctx + } return context.WithValue(c.ctx, CONTEXTK, c.H) } -- cgit v1.2.3