Commit 034b47ac authored by Barry Warsaw's avatar Barry Warsaw

_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.
parent b1c1de38
......@@ -135,8 +135,11 @@ class Parser:
r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)',
payload)
if not mo:
raise Errors.BoundaryError(
"Couldn't find starting boundary: %s" % boundary)
if self._strict:
raise Errors.BoundaryError(
"Couldn't find starting boundary: %s" % boundary)
container.set_payload(payload)
return
start = mo.start()
if start > 0:
# there's some pre-MIME boundary preamble
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment