Skip to content

Commit

Permalink
Fix missing TraceInfo when download callback is set(#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jan 5, 2023
1 parent fe5fafc commit 9d5943a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,10 @@ func (c *Client) roundTrip(r *Request) (resp *Response, err error) {
interval: r.downloadCallbackInterval,
}
}
ctx = context.WithValue(r.Context(), wrapResponseBodyKey, wrap)
if ctx == nil {
ctx = context.Background()
}
ctx = context.WithValue(ctx, wrapResponseBodyKey, wrap)
}
if ctx != nil {
req = req.WithContext(ctx)
Expand Down

0 comments on commit 9d5943a

Please sign in to comment.