Skip to content

Commit

Permalink
Check status code before retrying request
Browse files Browse the repository at this point in the history
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
  • Loading branch information
cenkalti committed Jan 13, 2023
1 parent 44ec1c1 commit 442d594
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cli/roundtripper.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 442d594

Please sign in to comment.