diff --git a/aws_s3--0.0.1.sql b/aws_s3--0.0.1.sql index 318cb2e..93ee6d0 100644 --- a/aws_s3--0.0.1.sql +++ b/aws_s3--0.0.1.sql @@ -92,9 +92,10 @@ AS $$ response = obj.get() content_encoding = response.get('ContentEncoding') body = response['Body'] + user_content_encoding = response.get('x-amz-meta-content-encoding') with tempfile.NamedTemporaryFile() as fd: - if content_encoding and content_encoding.lower() == 'gzip': + if (content_encoding and content_encoding.lower() == 'gzip') or (user_content_encoding and user_content_encoding.lower() == 'gzip'): with gzip.GzipFile(fileobj=body) as gzipfile: while fd.write(gzipfile.read(204800)): pass