Check status code before retrying request

Signed-off-by: Cenk Alti <cenkalti@gmail.com>
pull/11723/head
Cenk Alti 1 year ago
parent 44ec1c1575
commit 442d594570

@ -40,6 +40,9 @@ func (rt *retryingRoundTripper) roundTrip(req *http.Request, retry int, prevResp
if rtErr != nil {
return resp, rtErr
}
if resp.StatusCode < 500 {
return resp, rtErr
}
if resp.Header.Get("content-type") != "application/json" {
return resp, rtErr
}

Loading…
Cancel
Save