Commit ce09d2ed authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Add a missing case: ESI parent document gunzip'ed but included

document gzip'ed.

Fixes	#1029
parent ab7a91ed
......@@ -801,7 +801,7 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
vep->state = VEP_ATTR;
} else if (p < e) {
vep_error(vep,
"XML 1.0 Illegal attribute tart char");
"XML 1.0 Illegal attribute start char");
vep->state = VEP_TAGERROR;
}
} else if (vep->state == VEP_TAGERROR) {
......
......@@ -312,6 +312,9 @@ RES_WriteObj(struct sess *sp)
ESI_Deliver(sp);
} else if (sp->wrk->res_mode & RES_ESI_CHILD && sp->wrk->gzip_resp) {
ESI_DeliverChild(sp);
} else if (sp->wrk->res_mode & RES_ESI_CHILD &&
!sp->wrk->gzip_resp && sp->obj->gziped) {
res_WriteGunzipObj(sp);
} else if (sp->wrk->res_mode & RES_GUNZIP) {
res_WriteGunzipObj(sp);
} else {
......
varnishtest "#1029"
server s1 {
rxreq
expect req.url == "/bar"
txresp -gzipbody {[bar]}
rxreq
expect req.url == "/foo"
txresp -body {<h1>FOO<esi:include src="/bar"/>BARF</h1>}
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
if (req.url == "/foo") {
set beresp.ttl = 0s;
} else {
set beresp.ttl = 10m;
}
}
} -start
client c1 {
txreq -url "/bar" -hdr "Accept-Encoding: gzip"
rxresp
gunzip
expect resp.bodylen == 5
txreq -url "/foo" -hdr "Accept-Encoding: gzip"
rxresp
expect resp.bodylen == 21
} -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