]> err.no Git - varnish/commitdiff
ESI processing should ignore responses with no body.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 16 Sep 2008 18:56:10 +0000 (18:56 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 16 Sep 2008 18:56:10 +0000 (18:56 +0000)
Fixes #318

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3193 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt_esi.c
varnish-cache/bin/varnishtest/tests/r00318.vtc [new file with mode: 0644]

index e8113296e16628ef21a73799993c17e1e9b3660a..62df74fac966100c66922c297406c03a596f6ac1 100644 (file)
@@ -635,6 +635,9 @@ VRT_ESI(struct sess *sp)
                return;
        }
 
+       if (VTAILQ_EMPTY(&sp->obj->store))
+               return;
+
        CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
 
        if (!(params->esi_syntax & 0x00000001)) {
diff --git a/varnish-cache/bin/varnishtest/tests/r00318.vtc b/varnish-cache/bin/varnishtest/tests/r00318.vtc
new file mode 100644 (file)
index 0000000..50a8111
--- /dev/null
@@ -0,0 +1,22 @@
+# $Id$
+
+test "ESI with no body in response"
+
+server s1 {
+       rxreq 
+       txresp -status 302
+} -start
+
+varnish v1 -vcl+backend {
+       sub vcl_fetch {
+               esi;
+               pass;
+       }
+} -start
+
+client c1 {
+       txreq 
+       rxresp
+       expect resp.status == 302
+} -run
+