Bug 9222 - mod_deflate should check Content-Encoding header
Summary: mod_deflate should check Content-Encoding header
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_deflate (show other bugs)
Version: 2.0-HEAD
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-18 13:35 UTC by ASADA Kazuhisa
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 ASADA Kazuhisa 2002-05-18 13:35:35 UTC
Content with "Content-Encoding" header, content is encoded.
But mod_deflate does not check it. It cause to encode content twice.

This problem is reproduceible by get encoded content via mod_proxy.


Following is my trivial patch:
------------------------------------------------------------
--- mod_deflate.c	17 May 2002 11:33:09 -0000	1.5
+++ mod_deflate.c	17 May 2002 16:16:49 -0000
@@ -274,4 +274,11 @@
         }
 
+        /* encoded yet? */
+        accepts = apr_table_get(r->headers_out, "Content-Encoding");
+        if (accepts) {
+
    ap_remove_output_filter(f);
+
    return ap_pass_brigade(f->next, bb);
+
}
+
         /* if they don't have the line, then they can't play */
         accepts = apr_table_get(r->headers_in, "Accept-Encoding");
------------------------------------------------------------

Workaround for existing environment:
------------------------------------------------------------
<IfModule mod_deflate.c>
    SetEnvIf Content-Encoding ".*" no-gzip
</IfModule>
------------------------------------------------------------


Thanks for read my broken English.
Comment 1 Ian Holsman 2002-05-20 00:08:11 UTC
fixed in current CVS tree
Thanks Kazuhisa.