From: phk Date: Thu, 18 Dec 2008 10:13:42 +0000 (+0000) Subject: Add regression test for ticket 412 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7f84830dcd247518f1b17a037e2e4c914e548b1;p=varnish Add regression test for ticket 412 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3465 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/tests/r00412.vtc b/varnish-cache/bin/varnishtest/tests/r00412.vtc new file mode 100644 index 00000000..87bfdaf8 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/r00412.vtc @@ -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