Update CheckURLs function to treat HTTP 408 status as valid links alongside 401 and 403. This change enhances the URL validation logic by allowing for additional scenarios where links may be valid but require authorization or indicate a timeout.

This commit is contained in:
Luke Hagar
2025-09-16 20:57:56 +00:00
parent f3acb36e36
commit 2c3a5b5c04

View File

@@ -63,8 +63,8 @@ func CheckURLs(ctx context.Context, urls []string, sources map[string][]string,
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
// Treat 401/403 as valid links (exist but require authorization)
if status == http.StatusUnauthorized || status == http.StatusForbidden {
// Treat 401/403/408 as valid links
if status == http.StatusUnauthorized || status == http.StatusForbidden || status == http.StatusRequestTimeout {
ok = true
err = nil
}