]> granicus.if.org Git - apache/commitdiff
mod-deflate now checks to make sure gzip-only-text-html is set to 1, not anything.
authorIan Holsman <ianh@apache.org>
Wed, 7 Aug 2002 15:26:17 +0000 (15:26 +0000)
committerIan Holsman <ianh@apache.org>
Wed, 7 Aug 2002 15:26:17 +0000 (15:26 +0000)
This will allow things like...
SetEnv gzip-only-text/html 1
BrowserMatch "GECKO" gzip-only-text/html=0

Obtained from: Andr� Schild <A.Schild@aarboard.ch>
Reviewed by:   Ian Holsman

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

CHANGES
docs/manual/mod/mod_deflate.xml
modules/filters/mod_deflate.c

diff --git a/CHANGES b/CHANGES
index 6fa53aeeb88f0b03342ecfc1fa09823b87f32582..8a8bcaef2b408214d104cf286e03f55421d939d6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.40
 
+  *) mod-defalte now checks to make sure that 'gzip-only-text/html' is
+     set to 1, so we can exclude things from the general case with
+     browsermatch. [Ian Holsman, Andre Schild <A.Schild@aarboard.ch>]
+  
   *) Accept multiple leading /'s for requests within the DocumentRoot.
      PR 10946  [William Rowe, David Shane Holden <dpejesh@yahoo.com>]
 
index 041243e0c838278d26e7a9be55502bba9b5e7fff..214ccad4beb59cdc049a6bece2c6b4649072328a 100644 (file)
     <a href="../filter.html">filter</a>.  The following directive
     will enable compression for documents in the container where it
     is placed:</p>
-    <p><strong>Most popular browsers can not handle compression of all content
-        so you may want to enable the 'gzip-only-text/html' note (see below)
-    </strong></p>
+    <strong>
+    <p>Most popular browsers can not handle compression of all content
+        so you may want to set the 'gzip-only-text/html' note to 1 to only 
+        allow html files to be compressed (see below)</p>
+    <p>if you set this to anything but '1' it will be ignored, so you can do
+       negative matches</p>
+    </strong>
 
 <example>SetEnv gzip-only-text/html 1<br />
 SetOutputFilter DEFLATE
index 83e45446dfb730b400cdc60739e4a9f86e8feb0c..a456b0258eacd47b1fb28e4789768b5fe5df9fa9 100644 (file)
@@ -277,10 +277,13 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
          * other than text/html, so set gzip-only-text/html
          * (with browsermatch) for them
          */
-        if ((r->content_type == NULL
-             || strncmp(r->content_type, "text/html", 9))
-            && apr_table_get(r->subprocess_env, "gzip-only-text/html")) {
-            ap_remove_output_filter(f);
+        if (r->content_type == NULL
+             || strncmp(r->content_type, "text/html", 9)) {
+            const char *env_value = apr_table_get(r->subprocess_env,
+                                                  "gzip-only-text/html");
+            if ( env_value == NULL || strcmp(env_value,"1") ) {
+                ap_remove_output_filter(f);
+            }
             return ap_pass_brigade(f->next, bb);
         }