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

linkchecker: update handling of HTTP 401 unauthorized responses #11433

Closed
jayaddison opened this issue May 21, 2023 · 0 comments · Fixed by #11684
Closed

linkchecker: update handling of HTTP 401 unauthorized responses #11433

jayaddison opened this issue May 21, 2023 · 0 comments · Fixed by #11684

Comments

@jayaddison
Copy link
Contributor

jayaddison commented May 21, 2023

Describe the bug

In Sphinx releases since v1.3 the linkcheck builder has considered an HTTP 401 (unauthorized) response to be acceptable as confirmation that a hyperlinked reference is available and working (see #1687 for context).

That made sense at the time -- support for authentication in the linkcheck builder didn't arrive until Sphinx release v2.3.0 (see #6816) -- but I think that it might be an improvement to update the linkchecker to report references that return HTTP 401 as either 'ignored' or 'broken'.

Basically I think the ideal is to communicate to documentation authors and reviewers -- the likely users of the linkcheck builder -- where there are gaps or problems in the links that downstream readers may experience.

Sure, in some environments downstream readers may be expected to provide authentication information to access documents -- but for many projects the documentation is provided public and without requiring such auth. In either case, if an unauthorized response is received, the linkcheck user should be notified that something may not be accessible for their readers, and this could hint to them that they may need to update their config to add authentication to match user expectations.

How to Reproduce

I don't have a repro case to offer for this at the moment, but may add one later.

Environment Information

Affects sphinx v1.3 onwards.

Sphinx extensions

N/A

Additional context

Discovered during refactoring in #11432.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants