]> granicus.if.org Git - apache/commitdiff
mod_cache: Ensure that CacheDisable can correctly appear within
authorGraham Leggett <minfrin@apache.org>
Mon, 15 Aug 2011 21:28:08 +0000 (21:28 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 15 Aug 2011 21:28:08 +0000 (21:28 +0000)
a LocationMatch.

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

CHANGES
modules/cache/mod_cache.c

diff --git a/CHANGES b/CHANGES
index b05bf213fefbf3c2bf8fc9ca9f441737d9e82530..c3587b46b5e4c43f2c8c0962186d6d2a52654755 100644 (file)
--- 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]
index 96b25e63317aed8d70a09de8ae86635cff205e6b..b97a21c285b07e088dd7dbc248583d8d2e9036d0 100644 (file)
@@ -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);