From 5b80104c836a97e09348dc1bca963daa7f36ae4f Mon Sep 17 00:00:00 2001 From: demo Date: Sun, 10 May 2026 11:16:20 -0400 Subject: fix: check status code of response --- internal/links/fetch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/links/fetch.go b/internal/links/fetch.go index 864d754..53cc692 100644 --- a/internal/links/fetch.go +++ b/internal/links/fetch.go @@ -24,5 +24,9 @@ func fetch(rawURL string, timeoutSecs int) (io.Reader, error) { } defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status for %s for %s: %s", http.MethodGet, rawURL, resp.Status) + } + return bufio.NewReader(resp.Body), nil } -- cgit v1.2.3