[master] b6071fe If we know an beresp.body is zero bytes long, zap any Content-Encoding: it might have, it doesn't make any sense.

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 6 12:16:56 CEST 2014


commit b6071feb7a94cc2c76b103629c86ea8a5ac42ded
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 6 10:16:19 2014 +0000

    If we know an beresp.body is zero bytes long, zap any Content-Encoding: it
    might have, it doesn't make any sense.
    
    Fixes	#1602

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 03e366d..8045cd4 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -526,6 +526,9 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	if (!cache_param->http_gzip_support)
 		bo->do_gzip = bo->do_gunzip = 0;
 
+	if (bo->htc->content_length == 0)
+		http_Unset(bo->beresp, H_Content_Encoding);
+
 	bo->is_gzip = http_HdrIs(bo->beresp, H_Content_Encoding, "gzip");
 
 	bo->is_gunzip = !http_GetHdr(bo->beresp, H_Content_Encoding, NULL);



More information about the varnish-commit mailing list