Implementing req.do_gunzip

jonathan.huot at thomsonreuters.com jonathan.huot at thomsonreuters.com
Fri Feb 10 17:33:30 CET 2017


Hi varnish-dev,

We're currently migrating our vmods from varnish 3, and we have a vmod which
is uncompressing request's body to handle situation where backends are very old
and not able to handle gzip encoding... It happens sometime.

Instead of rewriting this vmod into a V4 module, I was guessing if you see the benefit of integrating into the core instead? It could be done by doing something like

set req.do_gunzip = true;


VTC could be approx..:

$ cat g00008.vtc
varnishtest "test basic gunzip for client request body"

server s1 {
        rxreq
        expect req.http.content-encoding == <undef>
        txresp -status 200
} -start

varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
        sub vcl_recv {
                set req.do_gunzip = true;
        }
} -start

client c1 {
        txreq -gzipbody {FOOBARFOO}
        rxresp
        expect resp.status == 200
} -run

varnish v1 -expect n_gzip == 0
varnish v1 -expect n_gunzip == 1


If you think it's interesting and any PR are welcomed, I will be glad to do one.
Else, I will upgrade our VMOD instead :-)

--
Jonathan Huot
Thomson Reuters


________________________________

This e-mail is for the sole use of the intended recipient and contains information that may be privileged and/or confidential. If you are not an intended recipient, please notify the sender by return e-mail and delete this e-mail and any attachments. Certain required legal entity disclosures can be accessed on our website.<http://site.thomsonreuters.com/site/disclosures/>



More information about the varnish-dev mailing list