api: use http request Clone (#1458)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-04-01 01:50:37 +03:00
parent 77176ca068
commit 5e8581146a

View File

@ -262,7 +262,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) {
for k, v := range matches { for k, v := range matches {
md[fmt.Sprintf("x-api-field-%s", k)] = v 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 break pathLoop
} }
if !pMatch { if !pMatch {