Duplicated Content-Length headers on pass

Henry Paulissen h.paulissen at qbell.nl
Tue Oct 26 10:52:23 CEST 2010

Yes, this was a RL problem for us (found it a month ago, but never reported
And I did this to solve it:

if (resp.status == 302) {
       remove resp.http.Content-Length;

in vcl_deliver.

The problem seems to be in chunked reponses and status codes other as 200
(maybe even only in 301/302).
Google Chrome is complaining about duplicate content-length headers and
there is already a bug report of it at the chrome dev team, other browsers
don't seem to dislike it.


-----Original Message-----
From: varnish-misc-bounces at varnish-cache.org
[mailto:varnish-misc-bounces at varnish-cache.org] On Behalf Of Tollef Fog Heen
Sent: dinsdag 26 oktober 2010 9:44
To: varnish-misc at varnish-cache.org
Subject: Duplicated Content-Length headers on pass

Hi all,

it seems like a small, but pesky bug snuck its way into 2.1.4, in which
you might see duplicated Content-Length headers when using pass.

As a workaround for this, I believe doing

  sub vcl_fetch {
    if (req.request != "HEAD") {
      unset beresp.http.content-length;

should work, or you can use the patch from

This will also hit the 2.1 SVN branch in a few minutes.

Feedback on whether this bug poses a real-world problem for people or
not would be most welcome.

Tollef Fog Heen
Varnish Software
t: +47 21 98 62 64

varnish-misc mailing list
varnish-misc at varnish-cache.org

More information about the varnish-misc mailing list