diff --git a/aiobotocore/endpoint.py b/aiobotocore/endpoint.py index adb30abd..3ff09a26 100644 --- a/aiobotocore/endpoint.py +++ b/aiobotocore/endpoint.py @@ -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())