]> granicus.if.org Git - apache/commitdiff
Explain why we have the regular file typecheck. No functional changes.
authorColm MacCarthaigh <colm@apache.org>
Mon, 26 Sep 2005 16:51:41 +0000 (16:51 +0000)
committerColm MacCarthaigh <colm@apache.org>
Mon, 26 Sep 2005 16:51:41 +0000 (16:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291672 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_dir.c

index 0ad60aae20cea6d218a6a5cb80a80fbe8b958662..eca688fe2773dd8fe086826b9e8e28447fe08a7c 100644 (file)
@@ -178,8 +178,17 @@ static int fixup_dir(request_rec *r)
 
         rr = ap_sub_req_lookup_uri(name_ptr, r, NULL);
 
-        /* XXX: (filetype == APR_REG) - we can't use a non-file index??? */
-        if (   rr->status == HTTP_OK
+        /* The sub request lookup is very liberal, and the core map_to_storage
+         * handler will almost always result in HTTP_OK as /foo/index.html
+         * may be /foo with PATH_INFO="/index.html", or even / with 
+         * PATH_INFO="/foo/index.html". To get around this we insist that the
+         * the index be a regular filetype.
+         *
+         * Another reason is that the core handler also makes the assumption 
+         * that if r->finfo is still NULL by the time it gets called, the 
+         * file does not exist.
+         */
+        if (rr->status == HTTP_OK
             && (   (rr->handler && !strcmp(rr->handler, "proxy-server"))
                 || rr->finfo.filetype == APR_REG)) {
             ap_internal_fast_redirect(rr, r);