Commit 54ee7279 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add the feature requested in #266: ignore non-esi tags entirely.



git-svn-id: http://www.varnish-cache.org/svn/trunk@3210 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d4c7701c
......@@ -466,6 +466,17 @@ esi_parse2(struct esi_work *ew)
continue;
}
/* Ignore non esi elements, if so instructed */
if ((params->esi_syntax & 0x02)) {
if (memcmp(p, "<esi:", i > 5 ? 5 : i) &&
memcmp(p, "</esi:", i > 6 ? 6 : i)) {
p += 1;
continue;
}
if (i < 6)
return (p);
}
/* Find end of this element */
for (q = p + 1; q < t.e && *q != '>'; q++)
continue;
......
......@@ -726,6 +726,7 @@ static const struct parspec parspec[] = {
tweak_uint, &master.esi_syntax, 0, UINT_MAX,
"Bitmap controlling ESI parsing code:\n"
" 0x00000001 - Don't check if it looks like XML\n"
" 0x00000002 - Ignore non-esi elements\n"
"Use 0x notation and do the bitor in your head :-)\n",
0,
"0", "bitmap" },
......
# $Id: e00008.vtc 3012 2008-07-24 12:22:35Z des $
test "Ignoring non esi elements"
server s1 {
rxreq
txresp -body {
<f<esi?
<esi:remove>
bar
</esi:remove>
foo
}
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
esi;
}
} -start -cli "param.set esi_syntax 2"
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 21
} -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