varnishtest "#1781 gzip checksum with multilevel esi"

server s1 {
	rxreq
	txresp -body {<esi:include src="/1"/>Baz}

	rxreq
	expect req.url == /1
	txresp -body {<esi:include src="/2"/>Bar}

	rxreq
	expect req.url == /2
	txresp -body {Foo}
} -start

varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend {
	sub vcl_backend_response {
		set beresp.do_gzip = true;
		set beresp.do_esi = true;
	}
} -start

client c1 {
	txreq
	rxresp
	expect resp.body == "FooBarBaz"

	txreq -hdr "Accept-Encoding: gzip"
	rxresp
	expect resp.http.content-encoding == "gzip"
	gunzip
	expect resp.body == "FooBarBaz"
} -run
