[master] 2ab29dc47 Test resp.filters with esi, gunzip and range

Nils Goroll nils.goroll at uplex.de
Sun Apr 5 14:16:08 UTC 2020


commit 2ab29dc47c1784748e46c60964ca86efa2cdd866
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Apr 5 14:22:16 2020 +0200

    Test resp.filters with esi, gunzip and range

diff --git a/bin/varnishtest/tests/e00015.vtc b/bin/varnishtest/tests/e00015.vtc
index c704f557c..4df48cec0 100644
--- a/bin/varnishtest/tests/e00015.vtc
+++ b/bin/varnishtest/tests/e00015.vtc
@@ -1,4 +1,4 @@
-varnishtest "ESI requests turned off"
+varnishtest "ESI requests turned off and other filters with esi"
 
 server s1 {
 	rxreq
@@ -52,7 +52,7 @@ varnish v1 -expect esi_errors == 0
 server s1 {
 	rxreq
 	expect req.url == /top2
-	txresp -body {
+	txresp -gzipbody {
 		<html>
 		Before include
 		<esi:include src="/body"/>
@@ -60,7 +60,7 @@ server s1 {
 	}
 	rxreq
 	expect req.url == /recurse
-	txresp -body {
+	txresp -gzipbody {
 		<html>
 		Before include
 		<esi:include src="/top2"/>
@@ -74,25 +74,52 @@ varnish v1 -syntax 4.1 -vcl+backend {
 		if (req.url == "/top2") {
 			set resp.do_esi = false;
 		}
+		set resp.http.filters = resp.filters;
 	}
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
 }
 
+# Note on Range requests: The range VDP is active, but as it cannot
+# reliably determine the size of the response, it falls back to a 200
 client c1 {
 	txreq -url /top2
 	rxresp
 	expect resp.bodylen == 73
 	expect resp.status == 200
 	expect resp.http.was == true
+	expect resp.http.filters == "gunzip"
+
 	txreq -url "/esi"
 	rxresp
 	expect resp.bodylen == 76
 	expect resp.status == 200
 	expect resp.http.was == true
+	expect resp.http.filters == "esi"
+
+	# see Note on Range above
+	txreq -url "/esi" -hdr "Range: bytes=1-2"
+	rxresp
+	expect resp.bodylen == 76
+	expect resp.status == 200
+	expect resp.http.was == true
+	expect resp.http.filters == "esi range"
+
 	txreq -url "/recurse"
 	rxresp
+	expect resp.bodylen == 120
+	expect resp.status == 200
+	expect resp.http.was == true
+	expect resp.http.filters == "esi gunzip"
+
+	# see Note on Range above
+	txreq -url "/recurse" -hdr "Range: bytes=1-2"
+	rxresp
+	expect resp.bodylen == 120
+	expect resp.status == 200
+	expect resp.http.was == true
+	expect resp.http.filters == "esi gunzip range"
 } -run
 
 varnish v1 -expect esi_errors == 0


More information about the varnish-commit mailing list