fix: discard http unsuccessful status
This commit is contained in:
parent
a181e35865
commit
cbb8ef5dfe
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ func (h *HTTPVehicle) Read() ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode < 200 && resp.StatusCode > 299 {
|
||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
return nil, errors.New(resp.Status)
|
||||
}
|
||||
buf, err := io.ReadAll(resp.Body)
|
||||
|
|
Loading…
Reference in a new issue