mirror of
https://github.com/honojs/hono.git
synced 2024-12-01 11:51:01 +01:00
fix(deno): 404 error on Serve Static Middleware (#863)
There will be a 404 error when non-standard characters appear in URL. Add `decodeURI()` to fix it.
This commit is contained in:
parent
a9746b2296
commit
ea4129123d
@ -21,7 +21,7 @@ export const serveStatic = (options: ServeStaticOptions = { root: '' }) => {
|
||||
const url = new URL(c.req.url)
|
||||
|
||||
let path = getFilePath({
|
||||
filename: options.path ?? url.pathname,
|
||||
filename: options.path ?? decodeURI(url.pathname),
|
||||
root: options.root,
|
||||
defaultDocument: DEFAULT_DOCUMENT,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user