From: Ryan Bloom Date: Sat, 25 Aug 2001 05:26:05 +0000 (+0000) Subject: Add the ability for mod_include to add the INCLUDES filter X-Git-Tag: 2.0.25~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27138ecd67bf2774c598e256fd28273a14689c51;p=apache Add the ability for mod_include to add the INCLUDES filter if the file is configured for the server-parsed handler. This makes the configuration for .shtml files much easier to understand, and allows mod_include to honor Apache 1.3 config files. Based on Doug MacEachern's patch to PHP to do the same thing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90655 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8bc3cbdf2e..7319155d76 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with Apache 2.0.25-dev + *) Add the ability for mod_include to add the INCLUDES filter + if the file is configured for the server-parsed handler. + This makes the configuration for .shtml files much easier + to understand, and allows mod_include to honor Apache 1.3 + config files. Based on Doug MacEachern's patch to PHP + to do the same thing. [Ryan Bloom] + *) force OpenSSL to ignore process local-caching and to always get/set/delete sessions using mod_ssl's callbacks [Madhusudan Mathihalli , diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 28d269bf5d..6230eb2294 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -2894,6 +2894,15 @@ static int xbithack_handler(request_rec *r) #endif } +static void insert_filter(request_rec *r) +{ + if (r->handler && (strcmp(r->handler, "server-parsed") == 0)) { + ap_add_output_filter("INCLUDES", NULL, r, r->connection); + r->content_type = "text/html"; + r->handler = "default-handler"; + } +} + static void register_hooks(apr_pool_t *p) { APR_REGISTER_OPTIONAL_FN(ap_ssi_get_tag_and_value); @@ -2901,6 +2910,7 @@ static void register_hooks(apr_pool_t *p) APR_REGISTER_OPTIONAL_FN(ap_register_include_handler); ap_hook_post_config(include_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST); ap_hook_handler(xbithack_handler, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_insert_filter(insert_filter, NULL, NULL, APR_HOOK_MIDDLE); ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_CONTENT); }