mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128982: Revert "#128982: Substitute regular expression in http.cookiejar.join_header_words for an efficient alternative (GH-128983)" and add tests (GH-130584)
* Revert "gh-128982: Substitute regular expression in `http.cookiejar.join_header_words` for an efficient alternative (GH-128983)"
This reverts commit 56e1900681
.
* Add tests
This commit is contained in:
parent
56e1900681
commit
9e474a98af
3 changed files with 18 additions and 8 deletions
|
@ -448,7 +448,7 @@ def join_header_words(lists):
|
|||
attr = []
|
||||
for k, v in pairs:
|
||||
if v is not None:
|
||||
if not v.isalnum() and '_' not in v:
|
||||
if not re.search(r"^\w+$", v):
|
||||
v = HEADER_JOIN_ESCAPE_RE.sub(r"\\\1", v) # escape " and \
|
||||
v = '"%s"' % v
|
||||
k = "%s=%s" % (k, v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue