Commit 298c7c38 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

We can not use a lenght based response when

	we transform (gzip/gunzip)
	we stream and backend didn't send c-l.

Fixes	#980

Testcase by:	Martin
parent 466c078f
......@@ -166,8 +166,8 @@ cnt_prepresp(struct sess *sp)
sp->wrk->res_mode = 0;
if (!sp->wrk->do_stream ||
(sp->wrk->h_content_length != NULL && !sp->wrk->do_gunzip))
if ((sp->wrk->h_content_length != NULL || !sp->wrk->do_stream) &&
!sp->wrk->do_gzip && !sp->wrk->do_gunzip)
sp->wrk->res_mode |= RES_LEN;
if (!sp->disable_esi && sp->obj->esidata != NULL) {
......
varnishtest "r00980 test gzip on fetch with content_length and do_stream"
server s1 {
rxreq
expect req.url == "/foobar"
expect req.http.accept-encoding == "gzip"
txresp -bodylen 43
} -start
varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
sub vcl_fetch {
set beresp.do_gzip = true;
set beresp.do_stream = true;
}
} -start
client c1 {
txreq -url /foobar -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == "gzip"
gunzip
expect resp.bodylen == 43
txreq -url /foobar
rxresp
expect resp.http.content-encoding == "resp.http.content-encoding"
expect resp.bodylen == 43
} -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