mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-30458: Use InvalidURL instead of ValueError. (GH-13044)
Use http.client.InvalidURL instead of ValueError as the new error case's exception.
This commit is contained in:
parent
e1d5dd645d
commit
b7378d7728
3 changed files with 8 additions and 6 deletions
|
@ -1091,7 +1091,7 @@ class HTTPConnection:
|
|||
url = '/'
|
||||
# Prevent CVE-2019-9740.
|
||||
if match := _contains_disallowed_url_pchar_re.search(url):
|
||||
raise ValueError(f"URL can't contain control characters. {url!r} "
|
||||
raise InvalidURL(f"URL can't contain control characters. {url!r} "
|
||||
f"(found at least {match.group()!r})")
|
||||
request = '%s %s %s' % (method, url, self._http_vsn_str)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue