]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_brotli: Handle new 'no-brotli' internal environment variable that
authorEvgeny Kotkov <kotkov@apache.org>
Tue, 27 Sep 2016 16:20:28 +0000 (16:20 +0000)
committerEvgeny Kotkov <kotkov@apache.org>
Tue, 27 Sep 2016 16:20:28 +0000 (16:20 +0000)
disables Brotli compression for a particular request.

This mimicks how mod_deflate handles the 'no-gzip' env variable, and
should allow seamless migration for configurations that use it.

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

modules/filters/mod_brotli.c

index 7b82fc9892937581282f8c4d350bd7df0476b1d0..f8a0a2c487a95e2ce9c956b649c3f3dd12943b85 100644 (file)
@@ -342,10 +342,12 @@ static apr_status_t compress_filter(ap_filter_t *f, apr_bucket_brigade *bb)
         const char *accepts;
 
         /* Only work on main request, not subrequests, that are not
-         * a 204 response with no content, and not a partial response
-         * to a Range request.
+         * a 204 response with no content, and are not tagged with the
+         * no-brotli env variable, and are not a partial response to
+         * a Range request.
          */
         if (r->main || r->status == HTTP_NO_CONTENT
+            || apr_table_get(r->subprocess_env, "no-brotli")
             || apr_table_get(r->headers_out, "Content-Range")) {
             ap_remove_output_filter(f);
             return ap_pass_brigade(f->next, bb);