]> err.no Git - varnish/commitdiff
Add regression test for ticket 412
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 18 Dec 2008 10:13:42 +0000 (10:13 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 18 Dec 2008 10:13:42 +0000 (10:13 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3465 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

diff --git a/varnish-cache/bin/varnishtest/tests/r00412.vtc b/varnish-cache/bin/varnishtest/tests/r00412.vtc
new file mode 100644 (file)
index 0000000..87bfdaf
--- /dev/null
@@ -0,0 +1,36 @@
+# $Id$
+
+test "Regression test for ticket 412"
+
+server s1 {
+       rxreq
+       expect req.url == "/"
+       txresp -status 303 -hdr "Location: /foo" 
+       rxreq
+       expect req.url == "/foo"
+       txresp -body "12345"
+} -start
+
+varnish v1 -vcl+backend {
+       sub vcl_fetch {
+               if (obj.status == 303) {
+                       set obj.cacheable = true;
+                       set obj.ttl = 60 s;
+                       set obj.http.X-Magic-Redirect = "1";
+                       set req.url = obj.http.Location;
+                       restart;
+               }
+       }
+       sub vcl_hit {
+               if (obj.http.X-Magic-Redirect == "1") {
+                       set req.url = obj.http.Location;
+                       restart;
+               }
+       }
+} -start
+
+client c1 {
+       txreq
+       rxresp
+       expect resp.status == 200
+} -run