-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Linkcheck fails on GitHub Doc URLs #10343
Comments
I don't think this is a bug in Sphinx since I see it even when trying to access the pages using cURL (see github/docs#17042). I AM able to get it to work by spoofing a user agent in the linkcheck_request_headers = {
r'https://docs.github.com/': {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; '
'rv:24.0) Gecko/20100101 Firefox/24.0'}
} |
Fantastic find, @dopplershift! Thanks for looking into this. |
Thanks @dopplershift for the investigation and solving the issue! |
@francoisfreitag: I'm not entirely sure that I agree with your conclusion. I agree that @dopplershift's investigation is great, and that it is wonderful to have a work-around for the problem. However, what is the purpose of However, I might suggest that this issue suggests that the Sphinx |
The “approved User-Agent” depends on the server linkcheck is connecting to, and your browser might not be the same as my browser. In this case, Firefox is accepted. In another, only Chromium might be accepted, or even a specific version of a browser might be accepted (IE 11 👋). Leaving the default |
Yeah. I realize that an "approved User-Agent" cannot be predicted by Sphinx. I completely agree with you on that. And it shouldn't be Sphinx's responsibility to "guess" the approved User-Agent. And I agree with you that it is probably outside the scope of Sigh. Ok. Thanks for the discussion @francoisfreitag! I'll track @dopplershift's question on the GitHub docs repo (github/docs#17042). |
Describe the bug
Sphinx linkcheck fails with a
403 Client Error: Forbidden
error on every GitHub Docs site URL, even though the links are correct and work fine.How to Reproduce
sphinx-quickstart
.docs.github.com
URL to theindex.rst
file, like so:make linkcheck
And you can verify that the above link works fine:
https://docs.github.com/en/get-started/quickstart/hello-world
Expected behavior
There should be no broken link error.
Your project
https://foundations.projectpythia.org/
Screenshots
No response
OS
Mac OS 11.6.5 and linux
Python version
3.10.4
Sphinx version
4.2.0+
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: