[3.0] 0a7e6ca Fix duplicate Content-Length headers with pass and stream

Martin Blix Grydeland martin at varnish-cache.org
Mon Aug 26 12:15:26 CEST 2013


commit 0a7e6caa0c6bd93003d4733e96f5ea054ac84cbc
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Aug 26 12:14:05 2013 +0200

    Fix duplicate Content-Length headers with pass and stream
    
    Fixes: #1272
    
    Patch by: ehocdet

diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index f22d48a..160dda7 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -352,9 +352,11 @@ RES_StreamStart(struct sess *sp)
 		http_Unset(sp->wrk->resp, H_Content_Encoding);
 
 	if (!(sp->wrk->res_mode & RES_CHUNKED) &&
-	    sp->wrk->h_content_length != NULL)
+	    sp->wrk->h_content_length != NULL) {
+		http_Unset(sp->wrk->resp, H_Content_Length);
 		http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp,
 		    "Content-Length: %s", sp->wrk->h_content_length);
+	}
 
 	sp->wrk->acct_tmp.hdrbytes +=
 	    http_Write(sp->wrk, sp->wrk->resp, 1);



More information about the varnish-commit mailing list