feat: implement relay loop detection in Apps Script and Cloudflare Worker

This commit is contained in:
Abolfazl
2026-05-05 07:15:52 +03:30
parent e300493b85
commit bd3d1943b0
3 changed files with 67 additions and 3 deletions
+10
View File
@@ -112,6 +112,16 @@ def classify_relay_error(raw: str) -> str:
"""
lower = raw.lower()
# Relay loop detected by Code.gs or a Cloudflare Worker exit node.
if "loop detected" in lower or lower == "loop_detected":
return (
"Relay loop detected. "
"Your exit node URL is misconfigured — it points back to a "
"Google Apps Script deployment or to the Cloudflare Worker itself. "
"Set 'exit_node_url' in config.json to the actual exit node address "
"(Cloudflare Worker, Deno Deploy, or VPS), not to a GAS script URL."
)
if any(p in lower for p in _QUOTA_PATTERNS):
return (
"Apps Script quota exhausted. "