api/handler/rpc: fix metadata cleanup (#1451)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-31 21:59:35 +03:00
parent 5376c788db
commit d0a368340a

2
rpc.go
View File

@ -289,9 +289,9 @@ func requestPayload(r *http.Request) ([]byte, error) {
for k, v := range md {
if strings.HasPrefix(k, "x-api-field-") {
matches[strings.TrimPrefix(k, "x-api-field-")] = v
}
delete(md, k)
}
}
// restore context without fields
ctx = metadata.NewContext(ctx, md)