Link Checker: Allow 403 status codes
Cloudflare likes to break the Internet, so we'll have to ignore 403 errors from sites in the link checker.
This commit is contained in:
@@ -117,6 +117,9 @@ def _url_exists(url: str) -> str:
|
|||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return ""
|
return ""
|
||||||
except requests.exceptions.HTTPError as e:
|
except requests.exceptions.HTTPError as e:
|
||||||
|
if e.response.status_code == 403:
|
||||||
|
return ""
|
||||||
|
|
||||||
print(f" - [{e.response.status_code}] <{url}>", file=sys.stderr)
|
print(f" - [{e.response.status_code}] <{url}>", file=sys.stderr)
|
||||||
return str(e.response.status_code)
|
return str(e.response.status_code)
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
|
|||||||
Reference in New Issue
Block a user