nandi/gleanpublic⑂ Fork 0
⑂ 6bc544d
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Refine HTTP status code validation range for parserUnverified

Julien Robert committed 2026-04-21T22:41:03+02:00 Browse files
6bc544d parent: 6bfb20e
modified internal/feed/fetcher.go +1 -1
@@ -52,7 +52,7 @@ func (f *Fetcher) Fetch(ctx context.Context, feedURL, etag, lastModified string)
5252 return nil, "", "", nil
5353 }
5454
55- if resp.StatusCode != http.StatusOK {
55+ if resp.StatusCode < 200 || resp.StatusCode >= 300 {
5656 return nil, "", "", fmt.Errorf("unexpected status: %d", resp.StatusCode)
5757 }
5858
@@ -52,7 +52,7 @@ func (f *Fetcher) Fetch(ctx context.Context, feedURL, etag, lastModified string)
52 return nil, "", "", nil52 return nil, "", "", nil
53 }53 }
54 54
55- if resp.StatusCode != http.StatusOK {55+ if resp.StatusCode < 200 || resp.StatusCode >= 300 {
56 return nil, "", "", fmt.Errorf("unexpected status: %d", resp.StatusCode)56 return nil, "", "", fmt.Errorf("unexpected status: %d", resp.StatusCode)
57 }57 }
58 58