(proxy_url: str)
| 150 | |
| 151 | |
| 152 | def _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 | |
| 163 | def _normalize_runtime_method(method: Optional[str]) -> str: |
no outgoing calls
no test coverage detected