support If-None-Match

This commit is contained in:
yuzuki999
2023-06-25 07:49:51 +08:00
parent 163cd2a6dc
commit 9af5d1a6e7
3 changed files with 7 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ func (c *Client) checkResponse(res *resty.Response, path string, err error) erro
if err != nil {
return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err)
}
if res.StatusCode() != 200 {
if res.StatusCode() >= 400 {
body := res.Body()
return fmt.Errorf("request %s failed: %s", c.assembleURL(path), string(body))
}