You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server serve static file from __dirname +"/static"
What do you see instead?
Windows: Server always returns "resource not found". console.log in the onNotFound handler shows path starting from "./C:/Users/..."
Linux: Working as it should
Additional information
That is probably is the reason of the problem
I think serveStatic should always expect absolute path or not modify the path. To make it safe just avoid ".." in the file name.
Also "static" (or probably the url prefix used during the middleware registration) is always added to the root path when searching for the file. It seams to be strange too.
The text was updated successfully, but these errors were encountered:
What version of Hono are you using?
4.6.3
What runtime/platform is your app running on?
Bun
What steps can reproduce the bug?
What is the expected behavior?
Server serve static file from __dirname +"/static"
What do you see instead?
Windows: Server always returns "resource not found". console.log in the onNotFound handler shows path starting from "./C:/Users/..."
Linux: Working as it should
Additional information
That is probably is the reason of the problem
I think serveStatic should always expect absolute path or not modify the path. To make it safe just avoid ".." in the file name.
Also "static" (or probably the url prefix used during the middleware registration) is always added to the root path when searching for the file. It seams to be strange too.
The text was updated successfully, but these errors were encountered: