Multipart read_chunk without content-length#750
Merged
kxepal merged 1 commit intoaio-libs:masterfrom Jan 28, 2016
Merged
Conversation
aiohttp/multipart.py
Outdated
Member
There was a problem hiding this comment.
No need to start docstring from space.
Member
|
Surprise to read about Chrome, but it's good to have |
Contributor
Author
|
@kxepal if no more comments, let's consider PR as ready-to-merge. |
Member
Member
|
Yes, looks good to me. |
7dda8eb to
8c7950f
Compare
pep8 fixes for PR fixes for PR fix typo don't search boundary twice
8c7950f to
f1351a3
Compare
Contributor
Author
|
@kxepal squashed and rebased. |
kxepal
added a commit
that referenced
this pull request
Jan 28, 2016
Multipart read_chunk without content-length
Member
|
@tumb1er thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows to read body parts of multipart/form-data request without Content-Length header for parts.
Current
BodyPartReader.read_chunkrequires Content-Length header to be set in body part. In fact, simple html form with file field doesn't send file length (at least in Chrome), so read_chunk is unusable for large binary file uploads.Proposed implementation does two things:
aiohttp.streams.StreamReaderviaunread_datamethod.Since next body part content may occure in last read chunk,
BodyPartReader._unreaddeque is not enough, and data should be returned toStreamReaderinstance.