Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES/10270.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
``MultipartForm.decode()`` must follow RFC1341 7.2.1 with a ``CRLF`` after the boundary
-- by :user:`imnotjames`.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Jaesung Lee
Jake Davis
Jakob Ackermann
Jakub Wilk
James Ward
Jan Buchar
Jan Gosmann
Jarno Elonen
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str:
return "".join(
"--"
+ self.boundary
+ "\n"
+ "\r\n"
+ part._binary_headers.decode(encoding, errors)
+ part.decode()
for part, _e, _te in self._parts
Expand Down
2 changes: 1 addition & 1 deletion tests/test_web_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ def read(self, size: int = -1) -> bytes:
(BodyPartReader(b"x", CIMultiDictProxy(CIMultiDict()), mock.Mock()), None),
(
mpwriter,
"--x\nContent-Type: text/plain; charset=utf-8\r\nContent-Length: 4\r\n\r\ntest",
"--x\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Length: 4\r\n\r\ntest",
),
),
)
Expand Down
Loading