fix: ensure we decode uri encoded filenames

This commit is contained in:
Andy Burke 2025-08-12 15:33:32 -07:00
parent 278a39a47b
commit 55f45b4e5b
3 changed files with 8 additions and 5 deletions

View file

@ -279,7 +279,7 @@ export default async function handle_static_files(request: Request, server: SERV
}
const url = new URL(request.url);
const normalized_path = path.resolve(path.normalize(url.pathname).replace(/^\/+/, ''));
const normalized_path = path.resolve(path.normalize(decodeURIComponent(url.pathname)).replace(/^\/+/, ''));
// if they're requesting something outside the working dir, just bail
if (!normalized_path.startsWith(Deno.cwd())) {