Hello!
On Tue, Mar 26, 2013 at 4:02 PM, <jdavidmitchell@gmail.com> wrote:
> On Friday, March 1, 2013 3:15:40 PM UTC-5, Ron Gomes wrote:
>>
>> Our URL rewriter has to interpret a request cookie whose value is a JSON
>> object that's been gzipped, encrypted, and base64-encoded. All the pieces I
>> need for this are part of the openresty bundle except for gzip decoding (as
>> far as I can tell).
>>
>> There seem to be several packages for this available in the wild. Can
>> someone suggest the best and easiest way that I can add gzip decoding
>> capability to our server?
>
> I have the same issue. Our cookie is gzipped (libz) and URL encoded. We
> are using PHP. PHP automatically url decodes a cookie, and we run
> gzuncompress. I would be great if we could replace our PHP with lua.
>
IMHO, the simplest solution is just to use LuaJIT's FFI API to call
zlib's C API directly from within a custom Lua module. The official
FFI tutorial does contain a sample for accessing zlib:
http://luajit.org/ext_ffi_tutorial.html
Best regards,
-agentzh