From: Andre Malo Date: Sat, 8 Mar 2003 17:08:34 +0000 (+0000) Subject: Check also err_headers_out for an already set Content-Encoding: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1411e01ba4a7cb68e49fed9b8aa1c0b096d4ca1;p=apache Check also err_headers_out for an already set Content-Encoding: gzip header. This prevents gzip compressed content from a CGI script from being compressed once more. PR: 17797 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98948 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 02019f88d6..cfb38456e6 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_deflate: Check also err_headers_out for an already set + Content-Encoding: gzip header. This prevents gzip compressed content + from a CGI script from being compressed once more. PR 17797. + [André Malo] + *) Forward port: Escape special characters (especially control characters) in mod_log_config to make a clear distinction between client-supplied strings (with special characters) and server-side diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index c14b10fff8..db65bd2f24 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -328,6 +328,18 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, * If gzip is present, don't gzip again. (We could, but let's not.) */ encoding = apr_table_get(r->headers_out, "Content-Encoding"); + if (encoding) { + const char *err_enc; + + err_enc = apr_table_get(r->err_headers_out, "Content-Encoding"); + if (err_enc) { + encoding = apr_pstrcat(r->pool, encoding, ",", err_enc, NULL); + } + } + else { + encoding = apr_table_get(r->err_headers_out, "Content-Encoding"); + } + if (encoding) { const char *tmp = encoding;