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

Extend linkchecker GET fallback logic to handle Too Many Redirects #8131

Closed
wants to merge 1 commit into from

Conversation

sbesson
Copy link
Contributor

@sbesson sbesson commented Aug 17, 2020

Subject: linkcheck - fallback to GET requests when HEAD requests returns Too Many Redirects

Feature or Bugfix

  • Bugfix

Purpose

Some websites will enter infinite redirect loops with HEAD requests. In this case, the GET fallback is ignored as the exception is of type TooManyRedirects and the link is reported as broken.
This extends the except clause to retry with a GET request for such scenarios.

Detail

Classifying this as a bug fix as URLs like https://idr.openmicroscopy.org/webclient/?show=well-119093 used to pass the linkchecking prior to Sphinx 3.2.0 but are now failing as HEAD requests have been enforced (#7936).

/cc @mtbc @jburel @manics @joshmoore

Some websites will enter infinite redirect loops with HEAD requests. In this
case, the GET fallback is ignored as the exception is of type TooManyRedirects
and the link is reported as broken.
This extends the except clause to retry with a GET request for such scenarios.
@sbesson
Copy link
Contributor Author

sbesson commented Nov 2, 2020

@tk0miya any feedback on whether this change might be considered for cherry-picking somewhere else of whether it is unconditionally closed (and if so, what is the rationale)?

@tk0miya
Copy link
Member

tk0miya commented Nov 22, 2020

OMG. It's an accident. I did not notice PR for the 3.2.x branch. I think this fix is worthy. So I'll merge this soon.

tk0miya added a commit to tk0miya/sphinx that referenced this pull request Nov 22, 2020
@tk0miya
Copy link
Member

tk0miya commented Nov 22, 2020

I cherry-picked the commit and posted a new PR as #8475. Sorry for my bad and thank you for your contribution!

@sbesson
Copy link
Contributor Author

sbesson commented Nov 23, 2020

No worries, thanks for cherry-picking and starting the discussion in #8475

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants