1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00

Fix headers in deflate_out_filter for the case of an empty first brigade

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104314 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Kew
2004-07-17 14:14:11 +00:00
parent 0e41475192
commit ef9d0abd34

View File

@@ -382,7 +382,9 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
}
}
/* don't deflate responses with zero length e.g. proxied 304's */
/* don't deflate responses with zero length e.g. proxied 304's but
* we do set the header on eos_only at this point for headers_filter
*/
for (bkt = APR_BRIGADE_FIRST(bb);
bkt != APR_BRIGADE_SENTINEL(bb);
bkt = APR_BUCKET_NEXT(bkt))
@@ -393,6 +395,13 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
}
}
if (eos_only) {
if (!encoding || !strcasecmp(encoding, "identity")) {
apr_table_set(r->headers_out, "Content-Encoding", "gzip");
}
else {
apr_table_merge(r->headers_out, "Content-Encoding", "gzip");
}
apr_table_unset(r->headers_out, "Content-Length");
return ap_pass_brigade(f->next, bb);
}