httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56067] New: FallbackResource doesn't work if directory exists
Date Mon, 27 Jan 2014 06:45:03 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56067

            Bug ID: 56067
           Summary: FallbackResource doesn't work if directory exists
           Product: Apache httpd-2
           Version: 2.4.7
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_dir
          Assignee: bugs@httpd.apache.org
          Reporter: tjerk.meesters@gmail.com

Observe the following directory structure:

 index.html
 test/
   bla.txt

And the following configuration:

 DirectoryIndex disabled
 DirectorySlash Off
 FallbackResource /index.html

This all works fine (index.html is shown) if the document can't be mapped to
the file system; however, when `/test/` is requested, it will show a 404 page.

This is also disussed in the following question:
http://serverfault.com/questions/568952/use-fallbackresource-even-if-directory-exists

I've written a patch for this:

 static int dir_fixups(request_rec *r)
 {
     if (r->finfo.filetype == APR_DIR) {
         /* serve up a directory */
 -        return fixup_dir(r);
 +        if (fixup_dir(r) == DECLINED) {
 +            return fixup_dflt(r);
 +        }
     }
     else if ((r->finfo.filetype == APR_NOFILE) && (r->handler == NULL)) {
         /* No handler and nothing in the filesystem - use fallback */
         return fixup_dflt(r);
     }
     return DECLINED;
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message