From adec9a01befd974f8e1bcbcfec6dbb758d2c518b Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 16 Sep 2008 18:56:10 +0000 Subject: [PATCH] ESI processing should ignore responses with no body. 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 | 3 +++ .../bin/varnishtest/tests/r00318.vtc | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 varnish-cache/bin/varnishtest/tests/r00318.vtc diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index e8113296..62df74fa 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -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 index 00000000..50a81114 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/r00318.vtc @@ -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 + -- 2.39.5