]> granicus.if.org Git - apache/commitdiff
Check also err_headers_out for an already set Content-Encoding:
authorAndre Malo <nd@apache.org>
Sat, 8 Mar 2003 17:08:34 +0000 (17:08 +0000)
committerAndre Malo <nd@apache.org>
Sat, 8 Mar 2003 17:08:34 +0000 (17:08 +0000)
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

CHANGES
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index 02019f88d6976501eec838b79f7f1498d9407a19..cfb38456e69d641c9b945787c393f8d6d089b5fd 100644 (file)
--- 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
index c14b10fff87fe849c3fefb999c6b29501b15f6ff..db65bd2f248c3e74dfff7f04ea568aaf7b41d781 100644 (file)
@@ -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;