{"action":"closed","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/852","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/852/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/852/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/852/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/852","id":149667666,"number":852,"title":"Http client HEAD request failed to release","user":{"login":"enzoliao","id":10289480,"avatar_url":"https://avatars.githubusercontent.com/u/10289480?v=3","gravatar_id":"","url":"https://api.github.com/users/enzoliao","html_url":"https://github.com/enzoliao","followers_url":"https://api.github.com/users/enzoliao/followers","following_url":"https://api.github.com/users/enzoliao/following{/other_user}","gists_url":"https://api.github.com/users/enzoliao/gists{/gist_id}","starred_url":"https://api.github.com/users/enzoliao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enzoliao/subscriptions","organizations_url":"https://api.github.com/users/enzoliao/orgs","repos_url":"https://api.github.com/users/enzoliao/repos","events_url":"https://api.github.com/users/enzoliao/events{/privacy}","received_events_url":"https://api.github.com/users/enzoliao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-20T05:56:39Z","updated_at":"2016-04-20T16:05:53Z","closed_at":"2016-04-20T16:05:53Z","body":"My code is as followed:\r\n``` Python\r\nimport aiohttp\r\nimport asyncio\r\n\r\nasync def head(url):\r\n    with aiohttp.ClientSession() as session:\r\n        async with session.head(url) as ret:\r\n            print(ret.status)\r\n\r\nloop = asyncio.get_event_loop()\r\nloop.run_until_complete(head(\"https://www.mongodb.org\"))\r\n```\r\nWhat I got is as followed\r\n```\r\n200\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py\", line 337, in run_until_complete\r\n    return future.result()\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py\", line 274, in result\r\n    raise self._exception\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py\", line 239, in _step\r\n    result = coro.send(None)\r\n  File \"<stdin>\", line 4, in head\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/client.py\", line 557, in __aexit__\r\n    yield from self._resp.release()\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/client_reqrep.py\", line 668, in release\r\n    chunk = yield from content.readany()\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/streams.py\", line 485, in wrapper\r\n    result = yield from func(self, *args, **kw)\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/streams.py\", line 548, in readany\r\n    return (yield from super().readany())\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/streams.py\", line 278, in readany\r\n    raise self._exception\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/parsers.py\", line 189, in set_parser\r\n    next(p)\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/protocol.py\", line 318, in __call__\r\n    out.feed_eof()\r\n  File \"/usr/local/lib/python3.5/site-packages/aiohttp/protocol.py\", line 392, in feed_eof\r\n    raise errors.ContentEncodingError('deflate')\r\naiohttp.errors.ContentEncodingError: 400, message='deflate'\r\n```\r\nWhen I change the url to \"https://www.python.org\", the error disappear. \r\nI notice that there is a \"Content-Encoding: gzip\" in the response header when I request \"https://www.mongodb.org\", while the response of \"https://www.python.org\" doesn't have the same header. I guess this is what matters.\r\nCould anybody give me some help on this? Thanks.\r\n\r\nPS. I'm using Python 3.5.1, aiohttp 0.21.5."}}