vtest "Test that esi+gzip correctly bypasses Vary: accept-encoding"

server s1 {
	rxreq
	expect req.http.accept-encoding == gzip
	txresp -hdr "Vary: Accept-encoding" -gzipbody {<esi:include src="/inc"/>}

	rxreq
	expect req.http.accept-encoding == gzip
	txresp -hdr "Vary: Accept-encoding" -gzipbody {FOO}
} -start

vinyl v1 -vcl+backend {
	sub vcl_backend_response {
		set beresp.do_esi = true;
	}
} -start

client c1 {
	txreq -hdr "Accept-encoding: gzip"
	rxresp
	expect resp.http.content-encoding == gzip
	expect resp.status == 200
	gunzip
	expect resp.bodylen == 3
	expect resp.body == FOO

	txreq
	rxresp
	expect resp.http.content-encoding == <undef>
	expect resp.status == 200
	expect resp.bodylen == 3
	expect resp.body == FOO
} -run
