google / brotli

Brotli compression format
MIT License
13.49k stars 1.24k forks source link

Add parameter for set maximum length after decompress #1149

Open ikrivosheev opened 6 months ago

ikrivosheev commented 6 months ago

Hello! It'll be great to have parameter max_length in Decompressor (http://python-hyper.org/projects/brotlipy/en/latest/api.html#brotli.Decompressor.decompress) like in python zlib: https://docs.python.org/3/library/zlib.html#zlib.Decompress.decompress.

The parameter mean that the return value will be no longer than max_length. I need it for use in http client. Related issue in aiohttp: https://github.com/aio-libs/aiohttp/issues/8248