From 39147026213aa900ae2a3221d9a1e1bebcec6769 Mon Sep 17 00:00:00 2001 From: Antonio Aranda <102337110+arandito@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:20:46 -0400 Subject: [PATCH] smithy-http: Disable auto-decompression in aiohttp client --- ...ithy-http-bugfix-0c383aa7346a4eb4b21cef8e2e0f201a.json | 4 ++++ packages/smithy-http/src/smithy_http/aio/aiohttp.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 packages/smithy-http/.changes/next-release/smithy-http-bugfix-0c383aa7346a4eb4b21cef8e2e0f201a.json diff --git a/packages/smithy-http/.changes/next-release/smithy-http-bugfix-0c383aa7346a4eb4b21cef8e2e0f201a.json b/packages/smithy-http/.changes/next-release/smithy-http-bugfix-0c383aa7346a4eb4b21cef8e2e0f201a.json new file mode 100644 index 000000000..41a1b01e0 --- /dev/null +++ b/packages/smithy-http/.changes/next-release/smithy-http-bugfix-0c383aa7346a4eb4b21cef8e2e0f201a.json @@ -0,0 +1,4 @@ +{ + "type": "bugfix", + "description": "Disabled automatic response decompression in `AIOHTTPClient`." +} diff --git a/packages/smithy-http/src/smithy_http/aio/aiohttp.py b/packages/smithy-http/src/smithy_http/aio/aiohttp.py index 3bfcbbeb3..5a330931d 100644 --- a/packages/smithy-http/src/smithy_http/aio/aiohttp.py +++ b/packages/smithy-http/src/smithy_http/aio/aiohttp.py @@ -65,7 +65,13 @@ def __init__( """ _assert_aiohttp() self._config = client_config or AIOHTTPClientConfig() - self._session = _session or aiohttp.ClientSession() + # Disable transparent response decompression and advertise + # 'identity' to request uncompressed responses. + # TODO: add a functional test once the test client framework exists + self._session = _session or aiohttp.ClientSession( + auto_decompress=False, + headers={"Accept-Encoding": "identity"}, + ) async def send( self,