Commit abc7561e authored by Geoff Simmons's avatar Geoff Simmons

Add a test to confirm disabling ESI with standard VCL means.

resp.do_esi in VCL 4.1, req.esi in 4.0.
parent 2507c255
varnishtest "disable ESI with standard VCL (resp.do_esi or req.esi)"
server s1 {
rxreq
txresp -body {<esi:include src="/body"/>}
} -start
server s2 {
rxreq
expect req.url == "/body"
txresp -body {foo}
} -start
varnish v1 -vcl+backend {
import ${vmod_pesi};
sub vcl_backend_fetch {
if (bereq.url == "/") {
set bereq.backend = s1;
}
else {
set bereq.backend = s2;
}
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
sub vcl_deliver {
if (req.http.Disable) {
set resp.do_esi = false;
}
pesi.activate();
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.body == "foo"
txreq -hdr "Disable: 1"
rxresp
expect resp.status == 200
expect resp.body == {<esi:include src="/body"/>}
} -run
varnish v1 -syntax 4.0 -vcl {
import ${vmod_pesi};
backend b { .host = "${bad_ip}"; }
sub vcl_deliver {
if (req.http.Disable) {
set req.esi = false;
}
pesi.activate();
}
}
client c1 -run
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