8000 bpo-30458: Disallow control chars in http URLs. by gpshead · Pull Request #12755 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-30458: Disallow control chars in http URLs. #12755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 1, 2019
Merged
Prev Previous commit
Next Next commit
fix indentation
  • Loading branch information
gpshead committed Apr 30, 2019
commit 73db8e16a07964ec5c0120ca28950e594e424582
4 changes: 2 additions & 2 deletions Lib/http/client.py
7BDF
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,8 @@ def putrequest(self, method, url, skip_host=False,
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} "
f"(found at least {match.group()!r})")
raise ValueError(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)

# Non-ASCII characters should have been eliminated earlier
Expand Down
0