summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Holsman <ianh@apache.org>2002-08-07 15:26:17 +0000
committerIan Holsman <ianh@apache.org>2002-08-07 15:26:17 +0000
commit29c48072956f526ce982d910e40395de43c9345f (patch)
treef053bcb47814674de9e1464387938e4d191343b4
parent27a37af0e2fc9c3f5f11a381609ab458c057afef (diff)
downloadhttpd-29c48072956f526ce982d910e40395de43c9345f.tar.gz
mod-deflate now checks to make sure gzip-only-text-html is set to 1, not anything.
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
-rw-r--r--CHANGES4
-rw-r--r--docs/manual/mod/mod_deflate.xml10
-rw-r--r--modules/filters/mod_deflate.c11
3 files changed, 18 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index 6fa53aeeb8..8a8bcaef2b 100644
--- 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>]
diff --git a/docs/manual/mod/mod_deflate.xml b/docs/manual/mod/mod_deflate.xml
index 041243e0c8..214ccad4be 100644
--- a/docs/manual/mod/mod_deflate.xml
+++ b/docs/manual/mod/mod_deflate.xml
@@ -25,9 +25,13 @@
<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
diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c
index 83e45446df..a456b0258e 100644
--- a/modules/filters/mod_deflate.c
+++ b/modules/filters/mod_deflate.c
@@ -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);
}