Commit e53821be authored by Geoff Simmons's avatar Geoff Simmons

add test g00003.vtc

parent 5e36127a
varnishtest "test gunzip on fetch"
server s1 {
rxreq
expect req.url == "/foo"
expect req.http.accept-encoding == "gzip"
txresp -gziplen 41
rxreq
expect req.url == "/bar"
expect req.http.accept-encoding == "gzip"
txresp -bodylen 42
rxreq
expect req.url == "/foobar"
expect req.http.accept-encoding == "gzip"
txresp -bodylen 43
} -start
varnish v1 -cliok "param.set http_gzip_support true" -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
backend dummy { .host = "${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="be", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
}
sub vcl_recv {
set req.backend_hint = backend_dyn.by_name("be");
}
sub vcl_backend_response {
set beresp.do_gunzip = true;
if (bereq.url == "/foobar") {
set beresp.do_gzip = true;
}
}
} -start
client c1 {
txreq -url /foo -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 41
txreq -url /bar -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 42
txreq -url /foobar -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == "gzip"
gunzip
expect resp.bodylen == 43
txreq -url /foobar
rxresp
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 43
} -run
varnish v1 -expect VBE.vcl1.be.happy == 0
varnish v1 -expect MAIN.n_backend == 2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment