summaryrefslogtreecommitdiff
path: root/modules/mappers/mod_dir.c
diff options
context:
space:
mode:
authorColm MacCarthaigh <colm@apache.org>2005-09-26 16:51:41 +0000
committerColm MacCarthaigh <colm@apache.org>2005-09-26 16:51:41 +0000
commit86751a71e47502c39965333fb94fdc48cd9a4d62 (patch)
treeca02fbc48351bf896b8a79c9cf84222eadbe8195 /modules/mappers/mod_dir.c
parent6eeba097be355f4218ee09732f3af698303580ae (diff)
downloadhttpd-86751a71e47502c39965333fb94fdc48cd9a4d62.tar.gz
Explain why we have the regular file typecheck. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291672 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_dir.c')
-rw-r--r--modules/mappers/mod_dir.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c
index 0ad60aae20..eca688fe27 100644
--- a/modules/mappers/mod_dir.c
+++ b/modules/mappers/mod_dir.c
@@ -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);