From 5e8581146ae2e8b78501e9c55b22b2518ba0354e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 1 Apr 2020 01:50:37 +0300 Subject: [PATCH] api: use http request Clone (#1458) Signed-off-by: Vasiliy Tolstov --- static.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static.go b/static.go index f391cd5..3cf3beb 100644 --- a/static.go +++ b/static.go @@ -262,7 +262,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) { for k, v := range matches { md[fmt.Sprintf("x-api-field-%s", k)] = v } - *req = *req.WithContext(context.WithValue(ctx, metadata.MetadataKey{}, md)) + *req = *req.Clone(context.WithValue(ctx, metadata.MetadataKey{}, md)) break pathLoop } if !pMatch {