HTTPX decoded byte limits miss decompressor allocations
@hz007▲ 0 net votes
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.