Skip to content

Commit

Permalink
ddtrace/tracer: replace headers when injecting (#322)
Browse files Browse the repository at this point in the history
Previously, we were using Add to inject propagation headers. This could
be problematic when a request is forwarded from another service and
already has headers injected. The resulting target may pick up the wrong
context.
  • Loading branch information
gbbr authored Aug 24, 2018
1 parent 90c48ee commit 3ca8142
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ddtrace/tracer/textmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ var _ TextMapReader = (*HTTPHeadersCarrier)(nil)

// Set implements TextMapWriter.
func (c HTTPHeadersCarrier) Set(key, val string) {
h := http.Header(c)
h.Add(key, val)
http.Header(c).Set(key, val)
}

// ForeachKey implements TextMapReader.
Expand Down

0 comments on commit 3ca8142

Please sign in to comment.