From: Graham Leggett Date: Thu, 12 Oct 2006 23:11:33 +0000 (+0000) Subject: mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an X-Git-Tag: 2.2.4~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ac7060c3466972dc21d9af378971b6c4b71b36b;p=thirdparty%2Fapache%2Fhttpd.git 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/ +1: minfrin, rpluem, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@463503 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d0501d550f8..e664540e790 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,15 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.4 + *) 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/ + [Davi Arnaut ] + *) mod_cache: Don't cache requests with a expires date in the past; otherwise mod_cache will always try to cache the URL. This bug might lead to numerous rename() errors on win32 if the URL was diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index 31cc2c46ec7..d7dd14a888e 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. */