linkcheck: Fall back to a GET request on 403 status

stable branch version of 2f46c7899c

Add changelog entry
This commit is contained in:
Tony Kelman 2016-08-21 22:22:07 -07:00
parent 14a1d5df29
commit 0d58607d8a
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ Bugs fixed
* #2870: flatten genindex columns' heights.
* #2856: Search on generated HTML site doesnt find some symbols
* #2882: Fall back to a GET request on 403 status in linkcheck
Release 1.4.6 (released Aug 20, 2016)
=====================================

View File

@ -183,10 +183,10 @@ class CheckExternalLinksBuilder(Builder):
f = opener.open(req, **kwargs)
f.close()
except HTTPError as err:
if err.code != 405:
if err.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
req = Request(req_url)
f = opener.open(req, **kwargs)
f.close()