-
-
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
An error occurred while receiving a compressed request by deflate method #1918
Comments
I am probably hitting this bug on the following example: import aiohttp
import asyncio
async def main(path):
async with aiohttp.ClientSession() as client:
url = 'http://httpbin.org' + path
async with client.get(url) as resp:
assert resp.status == 200
print(url)
print(resp.headers)
print(await resp.json())
print()
loop = asyncio.get_event_loop()
loop.run_until_complete(main('/gzip'))
loop.run_until_complete(main('/deflate')) Output:
|
I am not sure what I am not sure what we should do with not decodable responses. |
Here's what http://httpbin.org/deflate does. Browsers (at least chrome and firefox) have no trouble decoding it. |
seems browsers just support buggy servers. ok, we need to support it too |
What is buggy about it? Or alternatively, how does a correct |
|
wget can not parse response |
@asvetlov what do you think? with current implementation wget can read compressed responses but requests can not. |
browsers seems can read any |
If browsers support the case and we can implement it without very ugly hacks -- let's do it. |
question is should we do this at all, because browsers support current implementation, only requests doesn't. question about server side |
fixed in master |
I don't follow. How it affects sever side? |
I fixed |
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 461, in start
yield from payload.readany()
File "/usr/local/lib/python3.6/site-packages/aiohttp/streams.py", line 558, in readany
return (yield from super().readany())
File "/usr/local/lib/python3.6/site-packages/aiohttp/streams.py", line 305, in readany
raise self._exception
aiohttp.web_protocol.RequestPayloadError: 400, message='Can not decode content-encoding: deflate'
python-3.6
aiohttp-2.0.7
The text was updated successfully, but these errors were encountered: