mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Some sites also return 403 on HEAD requests
Atlassian websites will return a 403 Forbidden access code when queried, so add this to the list of codes that should trigger using a GET request as a fallback.
This commit is contained in:
parent
0b9ee8d451
commit
2f46c7899c
@ -162,10 +162,10 @@ class CheckExternalLinksBuilder(Builder):
|
||||
response = requests.head(req_url, **kwargs)
|
||||
response.raise_for_status()
|
||||
except HTTPError as err:
|
||||
if err.response.status_code != 405:
|
||||
if err.response.status_code not in (403, 405):
|
||||
raise
|
||||
# retry with GET if that fails, some servers
|
||||
# don't like HEAD requests and reply with 405
|
||||
# don't like HEAD requests and reply with 403 or 405
|
||||
response = requests.get(req_url, stream=True, **kwargs)
|
||||
response.raise_for_status()
|
||||
except HTTPError as err:
|
||||
|
Loading…
Reference in New Issue
Block a user