You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Traceback (most recent call last): File "repr.py", line 6, in <module> for part in MultipartDecoder(body, content_type).parts: File "/venv/lib/python3.7/site-packages/requests_toolbelt/multipart/decoder.py", line 111, in __init__ self._parse_body(content) File "/venv/lib/python3.7/site-packages/requests_toolbelt/multipart/decoder.py", line 137, in _parse_body boundary = b''.join((b'--', self.boundary)) AttributeError: 'MultipartDecoder' object has no attribute 'boundary'
As you see the boundary is missing in the content type. Would it be possible to detect this and raising a better error than AttributeError since AttributeError is very general and hard to catch.
Thanks a lot.
The text was updated successfully, but these errors were encountered:
Hi everybody,
we have a webservice which recently showed a 500 error. The root cause was a malformed multipart request.
Simplified example:
Error:
Traceback (most recent call last): File "repr.py", line 6, in <module> for part in MultipartDecoder(body, content_type).parts: File "/venv/lib/python3.7/site-packages/requests_toolbelt/multipart/decoder.py", line 111, in __init__ self._parse_body(content) File "/venv/lib/python3.7/site-packages/requests_toolbelt/multipart/decoder.py", line 137, in _parse_body boundary = b''.join((b'--', self.boundary)) AttributeError: 'MultipartDecoder' object has no attribute 'boundary'
As you see the boundary is missing in the content type. Would it be possible to detect this and raising a better error than AttributeError since AttributeError is very general and hard to catch.
Thanks a lot.
The text was updated successfully, but these errors were encountered: