Skip to content

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

@rchl

Description

@rchl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions