From 1d8184a974b68feccb29023f5bb99d7881af5807 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 15 Aug 2011 21:28:08 +0000 Subject: [PATCH] mod_cache: Ensure that CacheDisable can correctly appear within a LocationMatch. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1158022 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/cache/mod_cache.c | 28 ++++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index b05bf213fef..c3587b46b5e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.3.15 + *) mod_cache: Ensure that CacheDisable can correctly appear within + a LocationMatch. [Graham Leggett] + *) mod_cache: Fix the moving of the CACHE filter, which erroneously stood down if the original filter was not added by configuration. [Graham Leggett] diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 96b25e63317..b97a21c285b 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -2095,27 +2095,23 @@ static const char *add_cache_disable(cmd_parms *parms, void *dummy, return err; } - if (parms->path && !strcmp(url, "on")) { - url = parms->path; - } - if (url[0] != '/' && !ap_strchr_c(url, ':')) { - return "CacheDisable must specify a path or an URL, or when in a Location, " - "the word 'on'."; - } - - if (parms->path && strncmp(parms->path, url, strlen(parms->path))) { - return "When in a Location, CacheDisable must specify a path or an URL below " - "that location."; - } - conf = (cache_server_conf *)ap_get_module_config(parms->server->module_config, &cache_module); if (parms->path) { - dconf->disable = 1; - dconf->disable_set = 1; - return NULL; + if (!strcmp(url, "on")) { + dconf->disable = 1; + dconf->disable_set = 1; + return NULL; + } + else { + return "CacheDisable must be followed by the word 'on' when in a Location."; + } + } + + if (!url || (url[0] != '/' && !ap_strchr_c(url, ':'))) { + return "CacheDisable must specify a path or an URL."; } new = apr_array_push(conf->cachedisable); -- 2.47.2