varnishtest "Exercise ESI+gzip in pass mode"

server s1 {
	rxreq
	txresp -gzipbody {<esi:include src="/foo"/>}
	rxreq
	txresp -gzipbody "foo"
} -start

varnish v1 -vcl+backend {
	sub vcl_recv {
		return (pass);
	}
	sub vcl_backend_response {
		set beresp.do_esi = true;
	}
	sub vcl_deliver {
		set resp.http.can_esi = obj.can_esi;
	}
} -start

client c1 {
	txreq -hdr "Accept-Encoding: gzip"
	rxresp
	expect resp.status == 200
	expect resp.http.can_esi == "true"
	gunzip
	expect resp.bodylen == 3
} -run
