Skip to content

Commit

Permalink
Copy the gRPC metadata before modifying it.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Jan 30, 2017
1 parent eb0e1ee commit 4157d4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/otgrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func OpenTracingClientInterceptor(tracer opentracing.Tracer, optFuncs ...Option)
md, ok := metadata.FromContext(ctx)
if !ok {
md = metadata.New(nil)
} else {
md = md.Copy()
}
mdWriter := metadataReaderWriter{md}
err = tracer.Inject(clientSpan.Context(), opentracing.HTTPHeaders, mdWriter)
Expand Down

0 comments on commit 4157d4e

Please sign in to comment.