Merge pull request #11723 from cenkalti/leader-changed-fix

Check status code before retrying request
pull/11725/head
Matt Farina 2 years ago committed by GitHub
commit b2d5235c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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