From 86751a71e47502c39965333fb94fdc48cd9a4d62 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Mon, 26 Sep 2005 16:51:41 +0000 Subject: [PATCH] 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 --- modules/mappers/mod_dir.c | 13 +++++++++++-- 1 file 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); -- 2.40.0