check-links
check-links copied to clipboard
Option for Failing on Redirects?
A redirect can often indicate an architectural change of a website, that may lead to broken links later.
Would you be open for adding an option that would fail on redirects?
It would also support this feature in remark-lint-no-dead-urls
, which depends on check-links
. See further discussion here: https://github.com/davidtheclark/remark-lint-no-dead-urls/issues/15
It won't be as easy as passing in followRedirect: false
to got
unfortunately, because got
still resolves the promise when it encounters a redirect with that option set to false
:
Further reading: https://github.com/davidtheclark/remark-lint-no-dead-urls/issues/15#issuecomment-735223848
I guess probably a potential solution would be to check in the fetchHEAD
and fetchGET
resolver functions if the res.statusCode
is in the 3xx range (if the failOnRedirect
option is set).