mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-30532: Fix whitespace folding in certain cases
Leading whitespace was incorrectly dropped during folding of certain lines in the _header_value_parser's folding algorithm. This makes the whitespace handling code consistent.
This commit is contained in:
parent
f84ac420c2
commit
b350c22ebc
4 changed files with 15 additions and 3 deletions
|
@ -341,9 +341,7 @@ class TokenList(list):
|
|||
# avoid infinite recursion.
|
||||
ws = part.pop_leading_fws()
|
||||
if ws is not None:
|
||||
# Peel off the leading whitespace and make it sticky, to
|
||||
# avoid infinite recursion.
|
||||
folded.stickyspace = str(part.pop(0))
|
||||
folded.stickyspace = str(ws)
|
||||
if folded.append_if_fits(part):
|
||||
continue
|
||||
if part.has_fws:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue