Fix issue related to http status code in vault

the status code for success should be between
200 to 300.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-04-06 14:16:55 +05:30 committed by mergify[bot]
parent 37c4e3447d
commit 8b70e68f65

View File

@ -285,7 +285,7 @@ func (kms *VaultKMS) getAccessToken() (string, error) {
} }
func (kms *VaultKMS) processError(resp *http.Response, action string) error { func (kms *VaultKMS) processError(resp *http.Response, action string) error {
if resp.StatusCode >= 200 || resp.StatusCode < 300 { if resp.StatusCode >= 200 && resp.StatusCode < 300 {
return nil return nil
} }
body, err := ioutil.ReadAll(resp.Body) body, err := ioutil.ReadAll(resp.Body)