From: Nick Kew Date: Sat, 17 Jul 2004 14:14:11 +0000 (+0000) Subject: Fix headers in deflate_out_filter for the case of an empty first brigade X-Git-Tag: pre_ajp_proxy~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef9d0abd345c6fbd5f0550a48fe3fe28910a4056;p=apache 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 --- diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 90ec67368c..8856e62fe2 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -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); }