From 371b438a8a66cb6d76a87d14fe54af46c9a190d3 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Mon, 25 Jan 2016 22:31:19 +0000 Subject: [PATCH] mod_filter: Fix AddOutputFilterByType with non-content-level filters. PR58856 (Micha Lenk) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726705 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/filters/mod_filter.c | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index a6ad96a804..f4cbda6a23 100644 --- 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 ] *) mod_cache: Consider Cache-Control: s-maxage in expiration calculations. [Eric Covener] diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index 7b692233ee..5b5ecf6971 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -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); -- 2.40.0