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