Commit a53a8a1c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

On pass (from vcl_recv) we did not remove the backends Content-Length

header before adding our own.

We can not do this with the fetch filtering, because pass might send
HEAD requests to the backend.

XXX: It's arguable that the filtering stuff might be better done
inline than with a table.

Fixes: #801



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5461 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2855583f
......@@ -552,9 +552,11 @@ FetchBody(struct sess *sp)
assert(uu == sp->obj->len);
}
if (mklen > 0)
if (mklen > 0) {
http_Unset(sp->obj->http, H_Content_Length);
http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http,
"Content-Length: %u", sp->obj->len);
}
if (http_HdrIs(hp, H_Connection, "close"))
cls = 1;
......
# $Id$
test "Regression test for duplicate content-length in pass"
server s1 {
rxreq
txresp \
-hdr "Date: Mon, 25 Oct 2010 06:34:06 GMT" \
-hdr "Content-length: 10xx" \
-nolen -bodylen 10
} -start
varnish v1 -vcl+backend {
sub vcl_recv { return (pass); }
} -start
client c1 {
txreq
rxresp
expect resp.http.content-length == "10"
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment