Some of my upstreams send gzipped responses even though Accept-Encoding is empty, so I have to handle/ungzip them before I can process them further.
Currently, I am using lua-zlib to do that by instantiating ctx.inflate = zlib.inflate() in the header phase and calling it in the body filter phase.
Out of interest, I would like to substitute it with a luajit binding. Is anyone aware of such a project? The closest I have found is luapower's zlib library but it does not have a streaming API https://github.com/luapower/zlib
Because I couldn't find anything, I've thrown together a very rough first draft of what that could look like at https://github.com/luapower/zlib/pull/2
I lack the understanding and ffi experience to really implement, but maybe someone can join me? ;)