From 58b383ba4e0f44453cf23563e600e8b798b9d948 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 29 Sep 2022 09:16:35 +0200 Subject: [PATCH] Don't try to contact onion services --- app/utils/url.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/utils/url.py b/app/utils/url.py index 64cff05..80630b2 100644 --- a/app/utils/url.py +++ b/app/utils/url.py @@ -58,6 +58,10 @@ def is_url_valid(url: str) -> bool: logger.warning(f"{parsed.hostname} is blocked") return False + if parsed.hostname.endswith(".onion"): + logger.warning(f"{url} is an onion service") + return False + ip_address = _getaddrinfo( parsed.hostname, parsed.port or (80 if parsed.scheme == "http" else 443) )