Fix BodyPartReader.read_chunk crash on Content-Length: 0 by qianbkk · Pull Request #13795 · aio-libs/aiohttp · GitHub
Skip to content
Closed
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
6 changes: 6 additions & 0 deletions CHANGES/13758.bugfix.rst
2 changes: 1 addition & 1 deletion aiohttp/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ async def read_chunk(self, size: int = chunk_size) -> bytes:
if carry:
self._b64_carry = b""
want = max(want, self._boundary_len)
if self._length:
if self._length is not None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Add Required Changelog Fragment

This multipart parsing bug fix has no release-note fragment or required PR-numbered symlink. The repository directive requires both entries for this user-visible fix, so this repository requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

fresh = await self._read_chunk_from_length(want)
else:
fresh = await self._read_chunk_from_stream(want)
Expand Down
13 changes: 13 additions & 0 deletions tests/test_multipart.py
Loading