]> granicus.if.org Git - apache/commitdiff
content with "Content-Encoding" header, content is encoded.
authorIan Holsman <ianh@apache.org>
Mon, 20 May 2002 00:07:33 +0000 (00:07 +0000)
committerIan Holsman <ianh@apache.org>
Mon, 20 May 2002 00:07:33 +0000 (00:07 +0000)
But mod_deflate does not check it. It cause to encode content twice.

This problem is reproducable by getting encoded content via mod_proxy.

Patch Contributed by kaz@asada.sytes.net (ASADA Kazuhisa)
Bug #9222

Thanks Kazuhisa

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95181 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_deflate.c

index 7acae7d1dfde77b3967137456da57fa1656904c1..2547cd2432679e60801707bcfaa86108e0a4e454 100644 (file)
@@ -273,6 +273,12 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
             return ap_pass_brigade(f->next, bb);
         }
 
+        /* content is already encoded, so don't encode it again */
+        if (apr_table_get(r->headers_in, "Content-Encoding")) {
+            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");
         if (accepts == NULL) {