]> granicus.if.org Git - apache/commitdiff
mod_filter: Fix AddOutputFilterByType with non-content-level filters.
authorNick Kew <niq@apache.org>
Mon, 25 Jan 2016 22:31:19 +0000 (22:31 +0000)
committerNick Kew <niq@apache.org>
Mon, 25 Jan 2016 22:31:19 +0000 (22:31 +0000)
PR58856  (Micha Lenk)

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

CHANGES
modules/filters/mod_filter.c

diff --git a/CHANGES b/CHANGES
index a6ad96a8044bf66153f60afab05923ecfc021625..f4cbda6a23684bb6858e332a3f8edd1200d38b57 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
+
+  *) mod_filter: Fix AddOutputFilterByType with non-content-level filters.
+     PR58856 [Micha Lenk <micha lenk.info>]
  
   *) mod_cache: Consider Cache-Control: s-maxage in expiration
      calculations.  [Eric Covener]
index 7b692233ee007e38f2559de41dba91c8bd843729..5b5ecf69712a60aac7b4ce92d6fcc68e43124ffb 100644 (file)
@@ -444,6 +444,12 @@ static const char *add_filter(cmd_parms *cmd, void *CFG,
     ap_expr_info_t *node;
     const char *err = NULL;
 
+    /* if provider has been registered, we can look it up */
+    provider_frec = ap_get_output_filter_handle(pname);
+    if (!provider_frec) {
+        return apr_psprintf(cmd->pool, "Unknown filter provider %s", pname);
+    }
+
     /* fname has been declared with DeclareFilter, so we can look it up */
     frec = apr_hash_get(cfg->live_filters, fname, APR_HASH_KEY_STRING);
 
@@ -454,17 +460,13 @@ static const char *add_filter(cmd_parms *cmd, void *CFG,
             return c;
         }
         frec = apr_hash_get(cfg->live_filters, fname, APR_HASH_KEY_STRING);
+        frec->ftype = provider_frec->ftype;
     }
 
     if (!frec) {
         return apr_psprintf(cmd->pool, "Undeclared smart filter %s", fname);
     }
 
-    /* if provider has been registered, we can look it up */
-    provider_frec = ap_get_output_filter_handle(pname);
-    if (!provider_frec) {
-        return apr_psprintf(cmd->pool, "Unknown filter provider %s", pname);
-    }
     provider = apr_palloc(cmd->pool, sizeof(ap_filter_provider_t));
     if (expr) {
         node = ap_expr_parse_cmd(cmd, expr, 0, &err, NULL);