Remove the truncation logic in the validate process

This commit is contained in:
chenguowei
2025-07-22 11:52:27 +08:00
parent c2c69ffb82
commit b5251c1d63

View File

@@ -88,10 +88,7 @@ def validate_url(url: str, default_url: str, allowed_schemes: tuple = ("https",
if parsed.scheme not in allowed_schemes:
raise ValueError(f"URL scheme must be one of: {', '.join(allowed_schemes)}")
# Reconstruct URL with only scheme, netloc (removing path, query, fragment)
normalized_url = f"{parsed.scheme}://{parsed.netloc}"
return normalized_url
return url
def validate_url_with_path(url: str, default_url: str, required_suffix: str | None = None) -> str: