Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevate redirection to a warning tagged http-redirected #750

Merged
merged 3 commits into from Sep 4, 2023

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Aug 26, 2023

Include the HTTP status code and reason in the message.

Log ignored warning messages as information.

Closes: #64
Closes: #617

Include the HTTP status code and reason in the message.
The section header names are used when parsing linkcheckerrc.

This reverts commit f0b6ddd.
@cjmayo cjmayo merged commit 2185f6e into linkchecker:master Sep 4, 2023
10 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 4, 2023
Elevate redirection to a warning tagged http-redirected 2185f6e
@cjmayo cjmayo deleted the redirected branch September 4, 2023 18:40
fghaas added a commit to fghaas/cleura-docs that referenced this pull request Sep 20, 2023
Since linkchecker 10.3.0, external links that are being redirected
(that is, they result in HTTP 301 or 302, rather than 200) result in a
warning. Since we are running linkchecker in strict mode (that is, not
ignoring warnings), this means the link check now fails on such links.

This is not good, however it would also not be good to just ignore all
warnings, as we would if we ran with --no-warnings. We just don't want
to fail on redirects.

Unfortunately, the `ignorewarnings` option in the linkchecker
configuration file, which allows us to ignore only *specific* warnings
(like `http-redirected`, in this case) has no equivalent CLI option.

Thus, we must bring back the .linkcheckerrc file (which we dropped in
49eeb6e), and set that option in the
config file.

References:
https://linkchecker.github.io/linkchecker/man/linkchecker.html#return-value
https://linkchecker.github.io/linkchecker/man/linkcheckerrc.html#filtering
linkchecker/linkchecker#750
fghaas added a commit to fghaas/cleura-docs that referenced this pull request Sep 20, 2023
Since linkchecker 10.3.0, external links that are being redirected
(that is, they result in HTTP 301 or 302, rather than 200) result in a
warning. Since we are running linkchecker in strict mode (that is, not
ignoring warnings), this means the link check now fails on such links.

This is not good, however it would also not be good to just ignore all
warnings, as we would if we ran with --no-warnings. We just don't want
to fail on redirects.

Unfortunately, the `ignorewarnings` option in the linkchecker
configuration file, which allows us to ignore only *specific* warnings
(like `http-redirected`, in this case) has no equivalent CLI option.

Thus, we must bring back the .linkcheckerrc file (which we dropped in
49eeb6e), and set that option in the
config file.

References:
https://linkchecker.github.io/linkchecker/man/linkchecker.html#return-value
https://linkchecker.github.io/linkchecker/man/linkcheckerrc.html#filtering
linkchecker/linkchecker#750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: option to report/error on redirected links Check for 301(Moved Permanently)
1 participant