diff --git a/src/serve-static.ts b/src/serve-static.ts index b72ef26..9e1cf96 100644 --- a/src/serve-static.ts +++ b/src/serve-static.ts @@ -40,9 +40,7 @@ export const serveStatic = (options: ServeStaticOptions = { root: '' }): Middlew return next() } - const url = new URL(c.req.url) - - const filename = options.path ?? decodeURIComponent(url.pathname) + const filename = options.path ?? decodeURIComponent(c.req.path) let path = getFilePath({ filename: options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename, root: options.root,