MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _sanitize_proxy

Function _sanitize_proxy

browser_utils/debug_utils.py:197–211  ·  view source on GitHub ↗
(settings: Optional[Dict[str, Any]])

Source from the content-addressed store, hash-verified

195
196 # Helper to sanitize proxy settings
197 def _sanitize_proxy(settings: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:
198 if not settings:
199 return None
200 safe_settings = settings.copy()
201 server_val = safe_settings.get("server")
202 if isinstance(server_val, str) and "@" in server_val:
203 # Redact credentials in http://user:pass@host format
204 try:
205 parts = server_val.split("@")
206 scheme_creds = parts[0].split("://")
207 if len(scheme_creds) == 2:
208 safe_settings["server"] = f"{scheme_creds[0]}://***:***@{parts[1]}"
209 except Exception:
210 safe_settings["server"] = "REDACTED"
211 return safe_settings
212
213 context: Dict[str, Any] = {
214 "meta": {

Callers 1

capture_system_contextFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected