Bug 9222

Summary: mod_deflate should check Content-Encoding header
Product: Apache httpd-2 Reporter: ASADA Kazuhisa <kaz>
Component: mod_deflateAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED FIXED    
Severity: normal    
Priority: P3    
Version: 2.0-HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   

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.