From 77e3d132ccce17ecac2b4f8b9203ab091e89e864 Mon Sep 17 00:00:00 2001 From: KooshaPari Date: Sat, 12 Sep 2026 22:47:35 -0700 Subject: [PATCH] fix: reject non-HTTP URL schemes in http_check.py (fixes #316) --- python/http_check.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/http_check.py b/python/http_check.py index 462bdc4e..0434e302 100644 --- a/python/http_check.py +++ b/python/http_check.py @@ -246,6 +246,15 @@ def main(): print(f"[!] Invalid URL structure: '{url_to_test}'", file=sys.stderr) sys.exit(1) + # Validate URL scheme - only allow http and https + final_parsed = urllib.parse.urlparse(url_to_test) + if final_parsed.scheme and final_parsed.scheme.lower() not in ("http", "https"): + print( + f"[!] Error: Only http:// and https:// URLs are supported. Got scheme '{final_parsed.scheme}': '{url_to_test}'", + file=sys.stderr, + ) + sys.exit(1) + check_url_features(url_to_test)