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 c61ec82 commit 3e9437b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,18 @@ func (client *Client) GetFull(
childCtx, span := client.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
}

httpClient := &http.Client{
Timeout: 10 * time.Second,
Transport: otelhttp.NewTransport(http.DefaultTransport),
Transport: otelhttp.NewTransport(transport),
}

start := time.Now()
Expand Down

0 comments on commit 3e9437b

Please sign in to comment.