Commit afbaea43 authored by Artur Bergman's avatar Artur Bergman

It turns out that you could turn off ESI processing for subrequest and...

It turns out that you could turn off ESI processing for subrequest and compeltely hose the response. Ignore the flag if you are in a subrequest.

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4077 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 48d13a0e
......@@ -561,7 +561,10 @@ void
VRT_l_req_esi(struct sess *sp, unsigned process_esi)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
sp->disable_esi = !process_esi;
/* only allow you to turn of esi in the main request
else everything gets confused */
if(sp->esis == 0)
sp->disable_esi = !process_esi;
}
unsigned
......
......@@ -2,9 +2,6 @@
test "ESI requests turned off"
# There is probably a bug if an ESI subrequest turns ESI delivery back on
# XXX reminder so I don't forget it
server s1 {
rxreq
txresp -body {
......
# $Id: e00015.vtc 4068 2009-05-11 08:50:45Z sky $
test "ESI request can't be turned off midstream"
server s1 {
rxreq
txresp -body {
<html>
Before include
<esi:include src="/body"/>
<esi:include src="/body3"/>
After include
}
rxreq
expect req.url == "/body"
txresp -body {
<esi:include src="/body2">
}
rxreq
expect req.url == "/body2"
txresp -body {
included
}
rxreq
expect req.url == "/body3"
txresp -body {
included body3
}
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set req.esi = true;
if(req.url == "/body") {
set req.esi = false;
}
esi;
}
} -start
client c1 {
txreq
rxresp
expect resp.bodylen == 105
expect resp.status == 200
}
client c1 -run
varnish v1 -expect esi_errors == 0
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