[3.0] bdc88fb Honor remove-flag also when processing comments in ESI parsing.

Tollef Fog Heen tfheen at varnish-cache.org
Mon Apr 16 10:20:38 CEST 2012


commit bdc88fbb082022c56ab1aa475474a33cb9552e25
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Feb 14 15:02:32 2012 +0100

    Honor remove-flag also when processing comments in ESI parsing.
    
    Fixes: #1092

diff --git a/bin/varnishd/cache_esi_parse.c b/bin/varnishd/cache_esi_parse.c
index 3f3ab2b..ae45008 100644
--- a/bin/varnishd/cache_esi_parse.c
+++ b/bin/varnishd/cache_esi_parse.c
@@ -705,7 +705,6 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
 					vep->until_p = vep->until = "-->";
 					vep->until_s = VEP_NEXTTAG;
 					vep->state = VEP_UNTIL;
-					vep_mark_verbatim(vep, p);
 					break;
 				}
 				p++;
diff --git a/bin/varnishtest/tests/r01092.vtc b/bin/varnishtest/tests/r01092.vtc
new file mode 100644
index 0000000..26b0b9c
--- /dev/null
+++ b/bin/varnishtest/tests/r01092.vtc
@@ -0,0 +1,34 @@
+varnishtest "Test case for #1092 - esi:remove and comments"
+
+server s1 {
+	rxreq
+	txresp -body {
+		<html>
+		Keep-1
+		<!--esX Keep-22 -->
+		<!--esi Keep-333 -->
+		<esi:remove>
+		Remove-1
+		<!-- Remove-22 -->
+		<!--esi Remove-333 -->
+		Remove-4444
+		</esi:remove>
+		Keep-4444
+		</html>
+	}
+} -start
+
+varnish v1 -vcl+backend {
+	sub vcl_fetch {
+		set beresp.do_esi = true;
+	}
+} -start -cliok "param.set esi_syntax 4"
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.bodylen == 80
+}
+
+client c1 -run
+varnish v1 -expect esi_errors == 1



More information about the varnish-commit mailing list