diff --git a/CHANGELOG.md b/CHANGELOG.md index 51cba35c..38058dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ title: Releases result in invalid CSS (#1021) (contribution by Laurent P. René de Cotret) - Added `boolFieldM` (#1044) (contribution by 0xd34df00d) - Run HLint as part of GitHub Actions (#1045) (contribution by Yoo Chung) +- Running the `check` command will now consider URLs that respond with a 3XX code + (redirection) to be alive. ## Hakyll 4.16.3.0 (2024-10-24) diff --git a/lib/Hakyll/Check.hs b/lib/Hakyll/Check.hs index 4edb00dd..8cfd12b5 100644 --- a/lib/Hakyll/Check.hs +++ b/lib/Hakyll/Check.hs @@ -259,7 +259,8 @@ requestExternalUrl url = liftIO $ try $ do request <- Http.parseRequest url response <- Http.http (settings request) mgr let code = Http.statusCode (Http.responseStatus response) - return $ code >= 200 && code < 300 + -- Recall that 3XX status codes are redirections, which aren't necessarily errors. + return $ code >= 200 && code < 400 where -- Add additional request info settings r = r