Skip to content

Commit

Permalink
Clone headers
Browse files Browse the repository at this point in the history
  • Loading branch information
disq committed Dec 14, 2021
1 parent 044094b commit 4a03aaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func contextWithClient(ctx context.Context) context.Context {
cl.Addr = p.Addr
}
if md, ok := metadata.FromIncomingContext(ctx); ok {
cl.Metadata = md
cl.Metadata = md.Copy()
}
return client.NewContext(ctx, cl)
}
2 changes: 1 addition & 1 deletion config/confighttp/clientinfohandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func contextWithClient(req *http.Request) context.Context {
cl.Addr = ip
}

cl.Metadata = req.Header
cl.Metadata = req.Header.Clone()

ctx := client.NewContext(req.Context(), cl)
return ctx
Expand Down

0 comments on commit 4a03aaa

Please sign in to comment.