From 837d0b5bc1e02ab4d295c511583b90bd5dbab79b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 5 Sep 2024 19:19:16 +0100 Subject: [PATCH] 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. --- app/tasks/pkgtasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/tasks/pkgtasks.py b/app/tasks/pkgtasks.py index 4dce26ef..0a6df834 100644 --- a/app/tasks/pkgtasks.py +++ b/app/tasks/pkgtasks.py @@ -117,6 +117,9 @@ def _url_exists(url: str) -> str: response.raise_for_status() return "" except requests.exceptions.HTTPError as e: + if e.response.status_code == 403: + return "" + print(f" - [{e.response.status_code}] <{url}>", file=sys.stderr) return str(e.response.status_code) except requests.exceptions.ConnectionError: