From d7f84830dcd247518f1b17a037e2e4c914e548b1 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 18 Dec 2008 10:13:42 +0000 Subject: [PATCH] Add regression test for ticket 412 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3465 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../bin/varnishtest/tests/r00412.vtc | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 varnish-cache/bin/varnishtest/tests/r00412.vtc 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 -- 2.39.5