[master] 35b9981 Add a testcase for #1406 to -trunk, which is not affected.

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 13 22:49:18 CET 2014


commit 35b9981b5d79b9350cff10f15a95d28cc3ac0157
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 13 21:42:41 2014 +0000

    Add a testcase for #1406 to -trunk, which is not affected.

diff --git a/bin/varnishtest/tests/r01406.vtc b/bin/varnishtest/tests/r01406.vtc
new file mode 100644
index 0000000..491f9e9
--- /dev/null
+++ b/bin/varnishtest/tests/r01406.vtc
@@ -0,0 +1,35 @@
+varnishtest "#1406 empty header"
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend {
+	import ${vmod_std} ;
+
+	C{
+		static const struct gethdr_s VGC_HDR_REQ_foo =
+		    { HDR_REQ, "\020X-CUSTOM-HEADER:"};
+	}C
+
+	sub vcl_recv {
+		C{
+			VRT_SetHdr(ctx, &VGC_HDR_REQ_foo, 0, vrt_magic_string_end );
+		}C
+	}
+
+	sub vcl_deliver {
+		if (req.http.X-CUSTOM-HEADER) {
+			set resp.http.foo = "yes";
+		} else {
+			set resp.http.foo = "no";
+		}
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.http.foo == yes
+} -run



More information about the varnish-commit mailing list