mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
_parsebody(): Instead of raising a BoundaryError when no start
boundary could be found -- in a lax parser -- the entire body is assigned to the message payload.
This commit is contained in:
parent
b1c1de3805
commit
034b47acfe
1 changed files with 5 additions and 2 deletions
|
@ -135,8 +135,11 @@ class Parser:
|
||||||
r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)',
|
r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)',
|
||||||
payload)
|
payload)
|
||||||
if not mo:
|
if not mo:
|
||||||
raise Errors.BoundaryError(
|
if self._strict:
|
||||||
"Couldn't find starting boundary: %s" % boundary)
|
raise Errors.BoundaryError(
|
||||||
|
"Couldn't find starting boundary: %s" % boundary)
|
||||||
|
container.set_payload(payload)
|
||||||
|
return
|
||||||
start = mo.start()
|
start = mo.start()
|
||||||
if start > 0:
|
if start > 0:
|
||||||
# there's some pre-MIME boundary preamble
|
# there's some pre-MIME boundary preamble
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue