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 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>]
<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
* 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);
}