MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _validate_browser_proxy_url_local

Function _validate_browser_proxy_url_local

src/api/admin.py:152–160  ·  view source on GitHub ↗
(proxy_url: str)

Source from the content-addressed store, hash-verified

150
151
152def _validate_browser_proxy_url_local(proxy_url: str) -> tuple[bool, Optional[str]]:
153 if not proxy_url:
154 return True, None
155 normalized = proxy_url.strip()
156 if not re.match(r"^(http|https|socks5h?|socks5)://", normalized):
157 normalized = f"http://{normalized}"
158 if not re.match(r"^(socks5h?|socks5|http|https)://(?:([^:]+):([^@]+)@)?([^:]+):(\d+)$", normalized):
159 return False, "代理格式错误"
160 return True, None
161
162
163def _normalize_runtime_method(method: Optional[str]) -> str:

Callers 1

update_captcha_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected