We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a151a3a commit e5c341cCopy full SHA for e5c341c
docs/utils.py
@@ -223,9 +223,9 @@ def sanitize_url(url: str) -> str:
223
# Validate netloc
224
if parsed_url.netloc not in URL_ALLOWED_NETLOCS:
225
raise ValueError(INVALID_DOMAIN_ERROR)
226
- # Sanitize path and query
227
- sanitized_path = quote(parsed_url.path)
228
- sanitized_query = quote(parsed_url.query)
+ # Sanitize path and query - using the safe parameter to preserve URL structure
+ sanitized_path = quote(parsed_url.path, safe="/=")
+ sanitized_query = quote(parsed_url.query, safe="&=")
229
# Reconstruct the sanitized URL
230
return urlunparse((
231
parsed_url.scheme,
0 commit comments