MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / validate_url

Function validate_url

src/core/utils.py:305–316  ·  view source on GitHub ↗

验证 URL 格式 Args: url: URL Returns: 是否有效

(url: str)

Source from the content-addressed store, hash-verified

303
304
305def validate_url(url: str) -> bool:
306 """
307 验证 URL 格式
308
309 Args:
310 url: URL
311
312 Returns:
313 是否有效
314 """
315 pattern = r"^https?://[^\s/$.?#].[^\s]*$"
316 return bool(re.match(pattern, url))
317
318
319def sanitize_filename(filename: str) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected