Remove deadline check
This commit is contained in:
@@ -194,19 +194,7 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
for {
|
||||
r.replaceHostIfNeeded(req)
|
||||
|
||||
ctx, cancel := context.WithTimeout(req.Context(), time.Duration(r.timeoutSecs)*time.Second)
|
||||
defer cancel()
|
||||
req = req.WithContext(ctx)
|
||||
|
||||
resp, err = r.client.Do(req)
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
err = fmt.Errorf("request timed out after %d seconds", r.timeoutSecs)
|
||||
}
|
||||
default:
|
||||
}
|
||||
|
||||
if resp != nil && (resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent) {
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
if body != nil {
|
||||
|
||||
Reference in New Issue
Block a user