send icon indicating copy to clipboard operation
send copied to clipboard

Allow falling back to file when directory exists but doesn't have index

Open rchl opened this issue 5 years ago • 0 comments

It might make sense to allow falling back to files when a directory with the same name exists but doesn't have an index.html file.

(I'm using serve-static for unit-testing but I'm creating an issue against send as I think the functionality would have to be added here.)

Reproduction steps

Options:

{
  extensions: ['html'],
  redirect: false,
}

A directory structure like so:

| - fr/
| - fr/foo.html
| - fr.html
| - index.html

Try to load /fr path.

404 is returned because directory with fr name exists but doesn't have index.html file. In my case, I'd want it to fall back to the root file that actually exists and could be matched with extensions specified.

rchl avatar Jun 05 '20 12:06 rchl