8000 don't bother checking for chars above ascii. · python/cpython@448a541 · GitHub
[go: up one dir, main page]

Skip to content

Commit 448a541

Browse files
committed
don't bother checking for chars above ascii.
1 parent bde613c commit 448a541

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/http/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
# These characters are not allowed within http URL paths.
141141
# https://tools.ietf.org/html/rfc3986#section-3.3
142142
# in order to prevent CVE-2019-9740.
143-
_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f-\x9f]')
143+
# We don't restrict chars above \x7f as putrequest() limits us to ASCII.
144+
_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f]')
144145
# Arguably only these _should_ allowed:
145146
# _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")
146147
# We are more lenient for assumed real world compatibility purposes.

0 commit comments

Comments
 (0)
0