summaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-05-30 17:05:13 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2024-05-30 17:05:13 +0200
commit036d4a1b530b5d1b7a95d5a763064d479a59ba5c (patch)
tree8ad95e232654498ec4c841b2a0896f9cfed9e7f1 /types
parent8572e649446eeabe8aebb1887cc3d0bf61fc0c6e (diff)
Cookie: Return the context without handle if no handle was given
Diffstat (limited to 'types')
-rw-r--r--types/cookie/cookie.go3
1 files changed, 3 insertions, 0 deletions
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)
}