From ce1b8def774f703581eddb0e7ebcba3b49130c2c Mon Sep 17 00:00:00 2001 From: opm Date: Sun, 11 Oct 2026 20:06:32 -0400 Subject: [PATCH] fix(approvals): harden target regex against scheme truncation The target-extraction regex stopped at ':' and '/', so a dialog containing a full URL (e.g. 'http://verify.muse-dev.online/api/...') was captured as just the scheme ('http'). Add an optional '(?:https?://)?' prefix so the hostname is captured instead. This is defense-in-depth: the 2026-10-11 bare-scheme dialogs render 'http' directly from the app (closed source), but if the app resumes rendering full URLs, the extractor will now yield the hostname rather than the scheme. Verified against 5 cases: bare 'http' unchanged, full http/https URLs now yield hostnames, IPs and single-label hosts unchanged. --- bin/approvals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/approvals.py b/bin/approvals.py index fcbbfc7..e08c408 100755 --- a/bin/approvals.py +++ b/bin/approvals.py @@ -735,7 +735,7 @@ def inspect_node_approvals(node: str) -> dict: ip = None target = None m_t = re.search( - r"(?:connection to|share information with|contact|connect to)\s+([A-Za-z0-9][A-Za-z0-9.-]*[A-Za-z0-9])", + r"(?:connection to|share information with|contact|connect to)\s+(?:https?://)?([A-Za-z0-9][A-Za-z0-9.-]*[A-Za-z0-9])", card_text, ) if m_t: