Skip to content

Commit

Permalink
update util.base_url to handle python 3.9.17 change to urllib.parse.u…
Browse files Browse the repository at this point in the history
…rlsplit

https://docs.python.org/release/3.9.17/whatsnew/changelog.html#changelog

> gh-102153: urllib.parse.urlsplit() now strips leading C0 control and space characters following the specification for URLs defined by WHATWG in response to CVE-2023-24329. Patch by Illia Volochii.

python/cpython#102153
  • Loading branch information
snarfed committed Aug 15, 2023
1 parent 4abf3b0 commit a4ac1fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util.py
Expand Up @@ -586,7 +586,7 @@ def base_url(url):
Args:
url: string
"""
return urllib.parse.urljoin(url, ' ')[:-1] if url else None
return urllib.parse.urljoin(url, 'x')[:-1] if url else None


def is_web(url):
Expand Down

0 comments on commit a4ac1fa

Please sign in to comment.