summaryrefslogtreecommitdiffstats
path: root/modules/cache
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2006-09-26 16:36:43 +0200
committerGraham Leggett <minfrin@apache.org>2006-09-26 16:36:43 +0200
commitd010f24449d57380cccd15e456c6755708d6a7eb (patch)
treebc33a5d5b278a295e8099855e1653597a4011e3e /modules/cache
parentDon't cache requests with a expires date in the past; otherwise mod_cache will (diff)
downloadapache2-d010f24449d57380cccd15e456c6755708d6a7eb.tar.xz
apache2-d010f24449d57380cccd15e456c6755708d6a7eb.zip
mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
authority component and an empty path, the empty path is to be equivalent to "/". It explicitly cites the following four URIs as equivalents: http://example.com http://example.com/ http://example.com:/ http://example.com:80/ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450063 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cache')
-rw-r--r--modules/cache/cache_util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c
index 5889ec4bfc..f2f9179125 100644
--- a/modules/cache/cache_util.c
+++ b/modules/cache/cache_util.c
@@ -65,6 +65,18 @@ static int uri_meets_conditions(apr_uri_t filter, int pathlen, apr_uri_t url)
}
}
+ /* For HTTP caching purposes, an empty (NULL) path is equivalent to
+ * a single "/" path. RFCs 3986/2396
+ */
+ if (!url.path) {
+ if (*filter.path == '/' && pathlen == 1) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
/* Url has met all of the filter conditions so far, determine
* if the paths match.
*/