-
-
Notifications
You must be signed in to change notification settings - Fork 789
Closed
Labels
Description
What version of Hono are you using?
4.0.5
What runtime/platform is your app running on?
Deno
What steps can reproduce the bug?
I'm using Pagefind which generates the following file structure:
What is the expected behavior?
When the browser request the file /pagefind/pagefind.unknown_278027f53872923.pf_meta
it should be served correctly.
What do you see instead?
The browser gets a 404 error, and Hono logs
Error: Not a directory (os error 20): open './_site/pagefind/pagefind.unknown_278027f53872923.pf_meta/index.html'
Additional information
This is because Hono automatically add /index.html
to any file without an extension (See the code here: https://github.com/honojs/hono/blob/main/src/utils/filepath.ts#L19-L21)
It should check first if the file exist before adding the defaultDocument
sufix.