Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
m-yosefpor committed Dec 28, 2021
1 parent 80dbfe0 commit deeb1c7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ func NewHttp(name string, url string, rps float64, timeout time.Duration, tlsSki
Timeout: timeout,
}
customTransport := http.DefaultTransport.(*http.Transport).Clone()
if disableKeepAlives {
customTransport.DisableKeepAlives = true
}
customTransport.DisableKeepAlives = disableKeepAlives
if tlsSkipVerify {
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}
Expand Down Expand Up @@ -161,9 +159,8 @@ func (h *HTTP) sendRequest(ctx context.Context) HTTPResult {
},
}

req, _ := http.NewRequestWithContext(ctx, http.MethodGet, h.URL, nil)
clientTraceCtx := httptrace.WithClientTrace(req.Context(), httpTrace)
req = req.WithContext(clientTraceCtx)
clientTraceCtx := httptrace.WithClientTrace(ctx, httpTrace)
req, _ := http.NewRequestWithContext(clientTraceCtx, http.MethodGet, h.URL, nil)
if h.Host != "" {
req.Host = h.Host
}
Expand Down

0 comments on commit deeb1c7

Please sign in to comment.