]> err.no Git - varnish/commitdiff
Test If-Modified-Since
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 12:12:29 +0000 (12:12 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 12:12:29 +0000 (12:12 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2833 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/c00008.vtc [new file with mode: 0644]

diff --git a/varnish-cache/bin/varnishtest/tests/c00008.vtc b/varnish-cache/bin/varnishtest/tests/c00008.vtc
new file mode 100644 (file)
index 0000000..c799dc4
--- /dev/null
@@ -0,0 +1,34 @@
+# $Id$
+
+test "Test If-Modified-Since"
+
+server s1 {
+       rxreq
+       expect req.url == "/foo"
+       txresp -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" -body "11111\n"
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+       txreq -url "/foo"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.content-length == 6
+
+       txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT"
+       rxresp
+       expect resp.status == 200
+
+       txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
+       rxresp
+       expect resp.status == 304
+
+       txreq -url "/foo" -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:02 GMT"
+       rxresp
+       expect resp.status == 304
+} 
+
+client c1 -run
+
+client c1 -run