fix: normalize CPA base URL before saving

This commit is contained in:
root
2026-03-18 22:06:47 +08:00
parent e07d77b493
commit 2b9c759859

View File

@@ -307,6 +307,10 @@ def _normalize_config(cfg: Dict[str, Any]) -> Dict[str, Any]:
except (TypeError, ValueError):
cfg["proxy_pool_count"] = 1
cfg["proxy_pool_country"] = str(cfg.get("proxy_pool_country", "US") or "US").strip().upper() or "US"
cpa_base_url = str(cfg.get("cpa_base_url", "") or "").strip().rstrip("/")
if cpa_base_url.lower().endswith("/v0"):
cpa_base_url = cpa_base_url[:-3].rstrip("/")
cfg["cpa_base_url"] = cpa_base_url
return cfg