[master] 6dbfff12d avoid re-setting Accept-Encoding for ESI

Nils Goroll nils.goroll at uplex.de
Tue Nov 5 13:21:05 UTC 2019


commit 6dbfff12dca895534b090ef9283e75f85659fcfa
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Nov 5 14:18:30 2019 +0100

    avoid re-setting Accept-Encoding for ESI
    
    we should not emit ReqUnset / ReqHeader if A-E is already correct

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 498aca6f2..f9fe82241 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -161,9 +161,10 @@ ved_include(struct req *preq, const char *src, const char *host,
 	http_Unset(req->http, H_Range);
 
 	/* Set Accept-Encoding according to what we want */
-	http_Unset(req->http, H_Accept_Encoding);
 	if (ecx->isgzip)
 		http_ForceHeader(req->http, H_Accept_Encoding, "gzip");
+	else
+		http_Unset(req->http, H_Accept_Encoding);
 
 	/* Client content already taken care of */
 	http_Unset(req->http, H_Content_Length);


More information about the varnish-commit mailing list