-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #126 #148
Fix #126 #148
Conversation
Sorry, code for process chunks looks too complex to me. I would like to cleanup existing chunk processing first before adding new features. Guys, thoughts? |
Everything before 7d036de is cleanup. Currently aiohttp changes I do agree that there should be more cleaning-up, and I do agree the fix 7d036de and 6731131 is not beautiful. Nonetheless, something came up in my life yesterday, and I can no longer work on this issue. Sorry. |
def update_transfer_encoding(self): | ||
"""Analyze transfer-encoding header.""" | ||
te = self.headers.get('TRANSFER-ENCODING', '').lower() | ||
|
||
if self.compress: | ||
if self.chunked is False: | ||
raise ValueError("Compress is enabled while chunked is disabled.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you're trying to forbid pretty valid case. Chunks and compression could be used together to represent two semantic principals: 1) stream chunks, join and decode on server 2) stream chunks and decode on server on fly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a valid case. But aiohttp turned on chunked
when compress
is True -- even if chunked
is explicitly set to False. This is not a correct behavious, but to keep the old quirks.
I agree with @asvetlov that this PR turns request generation on more higher complexity level. |
@kxepal, This PR should've been closed. My changes kept all the quirks that aiohttp had. I wanted to keep the changes to a minimal, meaning no structure modifications. And I added some other ugly shit to make the tests pass. In retrospect, that was not a good idea, maybe somebody will come up with a proper clean way. |
This pull request fixes mainly #126, and some other things along the way.
Tests added.