Skip to content

Commit

Permalink
fix: copy DefaultTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Sep 21, 2024
1 parent e34ff9a commit b7e0503
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ func (c *Client) Get(
childCtx, span := c.tracer.Start(ctx, "HTTP request")
defer span.End()

var transport http.RoundTripper

transportRaw, ok := http.DefaultTransport.(*http.Transport)
if ok {
transport = transportRaw.Clone()
} else {
transport = http.DefaultTransport
}

client := &http.Client{
Timeout: 10 * 1000000000,
Transport: otelhttp.NewTransport(http.DefaultTransport),
Transport: otelhttp.NewTransport(transport),
}
start := time.Now()

Expand Down

0 comments on commit b7e0503

Please sign in to comment.