chore(poll): return NotModifiedTimeoutErr on 304

This commit is contained in:
Milas Bowman 2025-03-10 22:54:48 -04:00
parent 35a3c1c23a
commit bdf9298496
Signed by: milas
SSH key fingerprint: SHA256:ek2D5l1HA34B3wbdErz0QOXm1E46CVvyf/nM4Fwfx/U
4 changed files with 65 additions and 1 deletions

View file

@ -67,7 +67,12 @@ func (c *Client) PollRange(ctx context.Context, b Bucket, pk string, q PollRange
return nil, err
}
if resp.StatusCode != http.StatusOK {
switch resp.StatusCode {
case http.StatusOK:
break
case http.StatusNotModified:
return nil, NotModifiedTimeoutErr
default:
return nil, fmt.Errorf("http status code %d: %s", resp.StatusCode, body)
}