vtest "ESI ability to stitch gzip files together"


server s1 {
	rxreq
	txresp -body {
		<esi:remove>
		This is a test: Unseen University
		<esi:include src="trick question">
		<!--esi XXX -->
		</esi:remove>
		<esX>This is a test: Hello world
	}
} -start

vinyl v1 -syntax 4.0 -vcl+backend {
	sub vcl_recv {
		set req.esi = true;
	}
	sub vcl_backend_response {
		set beresp.do_esi = true;
		set beresp.do_gzip = true;
	}
} -start

vinyl v1 -cliok "param.set debug +esi_chop"
vinyl v1 -cliok "param.set http_gzip_support true"

client c1 {
	txreq  -hdr "Accept-Encoding: gzip"
	rxresp
	expect resp.http.content-encoding == gzip
	gunzip
	expect resp.status == 200
	expect resp.bodylen == 40
}

client c1 -run
vinyl v1 -expect esi_errors == 2
