fix: ensure we decode uri encoded filenames
This commit is contained in:
parent
278a39a47b
commit
55f45b4e5b
3 changed files with 8 additions and 5 deletions
|
@ -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())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue