Skip to content

Commit

Permalink
fix: shouldn't modify the origin request
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonqiu committed Jun 30, 2023
1 parent 9f0a6e1 commit 075001d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion instrumentation/net/http/otelhttp/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx))
}

r = r.WithContext(ctx)
r = r.Clone(ctx) // According to RoundTripper spec we shouldn't modify the origin request.
span.SetAttributes(semconvutil.HTTPClientRequest(r)...)
t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header))

Expand Down

0 comments on commit 075001d

Please sign in to comment.