diff --git a/scripts/taler-monitoring/check_qr_payloads.py b/scripts/taler-monitoring/check_qr_payloads.py index 7cd109d..74efde4 100755 --- a/scripts/taler-monitoring/check_qr_payloads.py +++ b/scripts/taler-monitoring/check_qr_payloads.py @@ -49,10 +49,13 @@ def looks_like_real_uri(uri: str) -> bool: return False if re.match(r"^taler://pay/?$", uri, re.I): return False - # trailing junk from HTML/JS - if uri.endswith((")", "(", "\\", "^", "*", "+", "?")): + # trailing junk / JS regex fragments (allow ? & = in query strings) + if uri.endswith((")", "(", "\\", "^", "*")): return False - if re.search(r"[\\^$*+?]", uri): + if re.search(r"[\\^$*]", uri): + return False + # lone incomplete `taler://…?` without path + if re.match(r"^taler://[^/]+$", uri, re.I): return False return True