fix request/response md handling

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-07-11 00:47:36 +03:00
parent 3f44a41d30
commit 35146aa717
2 changed files with 14 additions and 1 deletions

View File

@@ -147,6 +147,11 @@ func newRequest(ctx context.Context, log logger.Logger, addr string, req client.
if opts.AuthToken != "" {
header.Set(metadata.HeaderAuthorization, opts.AuthToken)
}
if opts.RequestMetadata != nil {
for k, v := range opts.RequestMetadata {
header.Set(k, v)
}
}
if md, ok := metadata.FromOutgoingContext(ctx); ok {
for k, v := range md {