Check response status code more strictly
This commit is contained in:
parent
519c58f847
commit
7fc04591ba
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