Bug 19913 - mod_deflate: "r->content_encoding" should be checked
Summary: mod_deflate: "r->content_encoding" should be checked
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_deflate (show other bugs)
Version: 2.0-HEAD
Hardware: PC Solaris
: P3 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-14 07:09 UTC by Tsuyoshi SASAMOTO
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tsuyoshi SASAMOTO 2003-05-14 07:09:22 UTC
"r->content_encoding" should be checked to avoid compressing a compressed file,
when an internal redirection occurs by mod_negotiation/mod_rewrite,
or "*.{html,txt,etc}.gz" is requested directly.

--- httpd-2.0/modules/filters/mod_deflate.c     Wed Mar 12 03:11:33 2003
+++ httpd-2.0/modules/filters/mod_deflate.c     Wed May 14 14:55:40 2003
@@ -340,6 +340,12 @@
             encoding = apr_table_get(r->err_headers_out, "Content-Encoding");
         }
 
+        if (r->content_encoding) {
+            encoding = encoding ? apr_pstrcat(r->pool, encoding, ",",
+                                              r->content_encoding, NULL)
+                                : r->content_encoding;
+        }
+
         if (encoding) {
             const char *tmp = encoding;
Comment 1 André Malo 2003-05-16 23:16:00 UTC
Yes, you're right. I've just committed your patch and proposed it for backport
into the stable branch.

Thanks for your report and thanks for using Apache.