[Core] Explicitly Support gzip & deflate for Encodings in Aiohttp - #48388
[Core] Explicitly Support gzip & deflate for Encodings in Aiohttp#48388kashifkhan wants to merge 7 commits into
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Restricts AioHttpTransport to supported response encodings, preventing decoding failures when optional aiohttp codecs are installed.
Changes:
- Defaults
Accept-Encodingtogzip, deflatewhile preserving caller overrides. - Relocates the aiohttp-specific body helper.
- Adds tests and updates package metadata.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
azure/core/pipeline/transport/_aiohttp.py |
Sets supported encodings and hosts the body helper. |
azure/core/rest/_aiohttp.py |
Imports the relocated helper. |
azure/core/utils/_pipeline_transport_rest_shared.py |
Removes aiohttp-specific logic. |
tests/async_tests/test_universal_http_async.py |
Tests defaults and caller overrides. |
CHANGELOG.md |
Documents the fix. |
azure/core/_version.py |
Bumps the version to 1.42.0. |
This comment has been minimized.
This comment has been minimized.
a9f7bcf to
2d688d8
Compare
[Pilot] PR Pipeline Failure AnalysisA CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green. What failedTwo separate pipelines failed:
Recommended next steps
Raw pipeline analysis (azsdk ci analyze)
|
This PR addresses an issue with
aiohttpandcore. Todayaiohttpautomatically appendsbr(Brotli) andzstdto theAccept-Encodingrequest header when it detects the corresponding optional library (e.g. brotli / brotlicffi ) installed in the environment.When the service honors that and returns a Brotli-encoded response,
azure-corecan't decode it: the aiohttp transport runs withauto_decompress=Falseand decompresses manually, supporting onlygzip / deflate, so the raw bytes reachresponse.text()and raise aUnicodeDecodeErrorRequest does similar, but lets
requests/urllib3decompress the response itself, so it decodes whatever it advertisedWe do the following:
gzipanddeflateforaiohttp