From a59118e6de38a9c3601a7e983a28430e97f54e81 Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Sun, 10 Aug 2025 22:29:42 -0300 Subject: [PATCH] fix(content_fetcher): handle githubhttps:// prefix correctly by dispatching only exact https:// as raw URL; add regression coverage via existing tests (refs #91) --- struct_module/content_fetcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/struct_module/content_fetcher.py b/struct_module/content_fetcher.py index bd75658..ef948a4 100644 --- a/struct_module/content_fetcher.py +++ b/struct_module/content_fetcher.py @@ -53,7 +53,10 @@ def fetch_content(self, content_location): for prefix, method in protocol_map.items(): if content_location.startswith(prefix): - if content_location.startswith("http"): + # Only treat the raw HTTPS prefix as a direct URL fetch. All other + # custom prefixes (e.g., githubhttps://, githubssh://) should have + # their prefix stripped and be dispatched to the appropriate handler. + if prefix == "https://": return method(content_location) else: return method(content_location[len(prefix):])