Skip to content

Commit bf94812

Browse files
committed
Merge pull request #4165 from Joshua-Anderson/response-code-range
fix(client-go): accept all non error HTTP codes
2 parents 15330f1 + 0e5f541 commit bf94812

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

client-go/controller/client/http.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ func (c Client) BasicRequest(method string, path string, body []byte) (string, e
100100
}
101101

102102
func checkForErrors(res *http.Response, body string) error {
103-
switch res.StatusCode {
104-
case http.StatusOK, http.StatusCreated, http.StatusNoContent:
103+
104+
// If response is not an error, return nil.
105+
if res.StatusCode > 199 && res.StatusCode < 400 {
105106
return nil
106107
}
107108

0 commit comments

Comments
 (0)