Skip to content

Commit

Permalink
Merge pull request #433 from aio-libs/fix-gzip
Browse files Browse the repository at this point in the history
bring back original Accept-Encoding
  • Loading branch information
jettify authored Nov 14, 2017
2 parents 29b2bd1 + 3dea865 commit 12dbdc5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions aiobotocore/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ def __init__(self, host,

@asyncio.coroutine
def _request(self, method, url, headers, data):
# Note: When using aiobotocore with dynamodb, requests fail on crc32
# checksum computation as soon as the response data reaches ~5KB.
# When AWS response is gzip compressed:
# 1. aiohttp is automatically decompressing the data
# (http://aiohttp.readthedocs.io/en/stable/client.html#binary-response-content)
# 2. botocore computes crc32 on the uncompressed data bytes and fails
# cause crc32 has been computed on the compressed data
# The following line forces aws not to use gzip compression,
# if there is a way to configure aiohttp not to perform decompression,
# we can remove the following line and take advantage of
# aws gzip compression.
# https://github.com/boto/botocore/issues/1255
headers['Accept-Encoding'] = 'identity'
headers_ = MultiDict(
(z[0], text_(z[1], encoding='utf-8')) for z in headers.items())

Expand Down

0 comments on commit 12dbdc5

Please sign in to comment.