[master] d099d7f6f esi can be turned off at esi_level > 0

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


commit d099d7f6f176ffbb1fc9e8f0e40d1f1eba3b8815
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Apr 5 13:47:35 2020 +0200

    esi can be turned off at esi_level > 0

diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index a94606daf..a911a3622 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -538,6 +538,8 @@ VRT_l_req_esi(VRT_CTX, VCL_BOOL process_esi)
 	/*
 	 * Only allow you to turn of esi in the main request
 	 * else everything gets confused
+	 * NOTE: this is not true, but we do not change behavior
+	 * for vcl 4.0. For 4.1, see VRT_l_resp_do_esi()
 	 */
 	if (IS_TOPREQ(ctx->req))
 		ctx->req->disable_esi = !process_esi;
@@ -874,10 +876,6 @@ VRT_l_resp_do_esi(VRT_CTX, VCL_BOOL process_esi)
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
 	assert(ctx->syntax >= 41);
-	/*
-	 * Only allow you to turn of esi in the main request
-	 * else everything gets confused
-	 */
 	ctx->req->disable_esi = !process_esi;
 }
 
diff --git a/bin/varnishtest/tests/e00015.vtc b/bin/varnishtest/tests/e00015.vtc
index e8b47deb7..c704f557c 100644
--- a/bin/varnishtest/tests/e00015.vtc
+++ b/bin/varnishtest/tests/e00015.vtc
@@ -58,6 +58,14 @@ server s1 {
 		<esi:include src="/body"/>
 		After include
 	}
+	rxreq
+	expect req.url == /recurse
+	txresp -body {
+		<html>
+		Before include
+		<esi:include src="/top2"/>
+		After include
+	}
 } -start
 
 varnish v1 -syntax 4.1 -vcl+backend {
@@ -83,6 +91,8 @@ client c1 {
 	expect resp.bodylen == 76
 	expect resp.status == 200
 	expect resp.http.was == true
+	txreq -url "/recurse"
+	rxresp
 } -run
 
 varnish v1 -expect esi_errors == 0


More information about the varnish-commit mailing list