diff --git a/vault/request_handling.go b/vault/request_handling.go index b95dd3b9f81ba..8b5b8d5b13e46 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -293,13 +293,13 @@ func (c *Core) HandleRequest(httpCtx context.Context, req *logical.Request) (res ctx, cancel := context.WithCancel(c.activeContext) defer cancel() - go func() { + go func(ctx context.Context, httpCtx context.Context) { select { case <-ctx.Done(): case <-httpCtx.Done(): cancel() } - }() + }(ctx, httpCtx) // Allowing writing to a path ending in / makes it extremely difficult to // understand user intent for the filesystem-like backends (kv,