]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
authorGraham Leggett <minfrin@apache.org>
Thu, 12 Oct 2006 23:11:33 +0000 (23:11 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 12 Oct 2006 23:11:33 +0000 (23:11 +0000)
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

CHANGES
modules/cache/cache_util.c

diff --git a/CHANGES b/CHANGES
index d0501d550f81657b04eaf990c7ed3f7aed35f2fa..e664540e790a57a72e8ab7dbc17fb9bd1517f520 100644 (file)
--- 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 <davi haxent.com.br>]
+
   *) 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
index 31cc2c46ec75d7f00de3da479b5fb0f2862c19a0..d7dd14a888e479522dfcc26c17c548eb0af2a447 100644 (file)
@@ -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.
      */