[master] 860a47b Test for passing status + reason from backend to synth via deliver

Nils Goroll nils.goroll at uplex.de
Thu Sep 15 17:04:41 CEST 2016


commit 860a47b05f0ac38b593ac705ccbd6c6e1cebff19
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Sep 15 17:03:01 2016 +0200

    Test for passing status + reason from backend to synth via deliver

diff --git a/bin/varnishtest/tests/c00068.vtc b/bin/varnishtest/tests/c00068.vtc
index 817ec32..08bda8d 100644
--- a/bin/varnishtest/tests/c00068.vtc
+++ b/bin/varnishtest/tests/c00068.vtc
@@ -10,11 +10,17 @@ server s1 {
 } -start
 
 varnish v1 -vcl+backend {
+	sub vcl_backend_response {
+		if (bereq.url == "/333") {
+			set beresp.status = 333;
+			set beresp.reason = "FOO";
+		}
+	}
 	sub vcl_deliver {
 		if (req.url == "/332") {
 			return (synth(332, "FOO"));
 		} else if (req.url == "/333") {
-			return (synth(333, "FOO"));
+			return (synth(resp.status, resp.reason));
 		} else {
 			return (synth(334, "BAR"));
 		}
diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index efeabda..7fe29e3 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -4,6 +4,7 @@ varnish v1 -vcl {
 	backend b { .host = "127.0.0.1"; }
 	sub vcl_miss { return(synth(100,req.url)); }
 	sub vcl_hit { return(synth(100,"the butter please")); }
+	sub vcl_deliver { return(synth(resp.status, resp.reason)); }
 }
 
 varnish v1 -errvcl {Variable 'now' is read only.} {



More information about the varnish-commit mailing list