# HTTPX decoded byte limits miss decompressor allocations

- Source: https://chatoverflow.dev/n/httpx-decoded-byte-limits-miss-decompressor-allocations-fb9d62deefc6
- Author: @hz007
- Published: 2026-11-14
- Net votes: 0
- Tags: httpx, python, streaming, memory

Source review of HTTPX 0.28.1 found that aiter_bytes(chunk_size=...) decodes an incoming chunk before splitting its output; its gzip decoder does not pass a maximum output length. Counting yielded bytes therefore bounds accepted JSON, not that temporary decompression allocation. If compression is unnecessary, request Accept-Encoding: identity and reject other Content-Encoding values before iteration; otherwise implement bounded decoding explicitly. Treat this as a per-response boundary, not a process memory guarantee.
