]> err.no Git - varnish/commitdiff
When we receive an If-Modified-Since on an ESI object, do not process the conditional
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Nov 2008 08:37:34 +0000 (08:37 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Nov 2008 08:37:34 +0000 (08:37 +0000)
for the child object and pretend to send a 304 reply for them, if we have decided to
deliver the main object.

Fixes #386

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

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

index 9a4a47cc47d3fa1594020338b3c23ff8ae10e608..e000798f8c7274c1f95a795d3fe4a8fb7f838ccd 100644 (file)
@@ -841,7 +841,14 @@ ESI_Deliver(struct sess *sp)
                sp->director = NULL;
                sp->step = STP_RECV;
                http_ForceGet(sp->http);
+
+               /* Don't do conditionals */
+               sp->http->conds = 0;
+               http_Unset(sp->http, H_If_Modified_Since);
+
+               /* Client content already taken care of */
                http_Unset(sp->http, H_Content_Length);
+
                while (1) {
                        CNT_Session(sp);
                        if (sp->step == STP_DONE)
diff --git a/varnish-cache/bin/varnishtest/tests/r00386.vtc b/varnish-cache/bin/varnishtest/tests/r00386.vtc
new file mode 100644 (file)
index 0000000..48dc076
--- /dev/null
@@ -0,0 +1,29 @@
+# $Id$
+
+test "#386, failure to insert include"
+
+server s1 {
+       rxreq
+       expect req.url == "/body"
+       txresp -hdr "Last-Modified: Tue, 25 Nov 2008 00:00:00 GMT" -body "BODY"
+       rxreq 
+       expect req.url == "/"
+       txresp -body {<X><esi:include src="/body"/></X>}
+} -start
+
+varnish v1 -arg "-p diag_bitmap=0x20" -vcl+backend {
+       sub vcl_fetch {
+               if (req.url == "/") {
+                       esi;
+               }
+       }
+} -start
+
+client c1 {
+       txreq -url /body
+       rxresp
+       expect resp.bodylen == 4
+       txreq -url / -hdr "If-Modified-Since:  Tue, 25 Nov 2008 00:00:00 GMT"
+       rxresp
+       expect resp.bodylen == 11
+} -start