safer

Massimo Melina committed Mar 23, 2023 at 21:17 UTC 3bb2325a0462765378bb1321f4b020988573ac84
1 file changed +1 -1
src/vfs.ts
+1 -1
@@ -80,7 +80,7 @@ export async function urlToNode(url: string, ctx?: Koa.Context, parent: VfsNode=
80 if (!name)
81 return parent
82 const rest = nextSlash < 0 ? '' : url.slice(nextSlash+1, url.endsWith('/') ? -1 : undefined)
83 - if (dirTraversal(name) || /[\/]/.test(name)) {
83 + if (dirTraversal(name) || /[\\/]/.test(name)) {
84 if (ctx)
85 ctx.status = HTTP_FOOL
86 return