Skip to content

Commit

Permalink
Make HTTP 3XX codes successful in the check command
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Nov 5, 2024
1 parent d8e9b3a commit 8170110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion lib/Hakyll/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8170110

Please sign in to comment.