Check response status code more strictly
This commit is contained in:
parent
1ca785de16
commit
848356eb08
2
lemmy.go
2
lemmy.go
@ -140,7 +140,7 @@ func resError(res *http.Response, lr types.LemmyResponse) error {
|
|||||||
Code: res.StatusCode,
|
Code: res.StatusCode,
|
||||||
ErrStr: lr.Error.MustValue(),
|
ErrStr: lr.Error.MustValue(),
|
||||||
}
|
}
|
||||||
} else if res.StatusCode > 299 {
|
} else if res.StatusCode != http.StatusOK {
|
||||||
return types.HTTPError{
|
return types.HTTPError{
|
||||||
Code: res.StatusCode,
|
Code: res.StatusCode,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user