Skip to content

Commit e5c341c

Browse files
[PATCH] Apply changes from review (- WIP PR #373 -)
* This work is related to GHI #213 Changes in file docs/utils.py: * tweaked sanitize_url * related work
1 parent a151a3a commit e5c341c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ def sanitize_url(url: str) -> str:
223223
# Validate netloc
224224
if parsed_url.netloc not in URL_ALLOWED_NETLOCS:
225225
raise ValueError(INVALID_DOMAIN_ERROR)
226-
# Sanitize path and query
227-
sanitized_path = quote(parsed_url.path)
228-
sanitized_query = quote(parsed_url.query)
226+
# Sanitize path and query - using the safe parameter to preserve URL structure
227+
sanitized_path = quote(parsed_url.path, safe="/=")
228+
sanitized_query = quote(parsed_url.query, safe="&=")
229229
# Reconstruct the sanitized URL
230230
return urlunparse((
231231
parsed_url.scheme,

0 commit comments

Comments
 (0)