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;
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" },
--- /dev/null
+# $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