fix: "#" inside file names was not supported
Massimo Melina committed
Mar 18, 2022 at 10:31 UTC
634fc59562fb51995dd8ae390ca6e67e582c60c0
1 file changed
+1
-1
server/src/vfs.ts
+1
-1
@@ -65,7 +65,7 @@ function inheritFromParent(parent: VfsNode, child: VfsNode) {
65
66
export async function urlToNode(url: string, ctx?: Koa.Context, parent: VfsNode=vfs) : Promise<VfsNode | undefined> {
67
let i = url.indexOf('/', 1)
68
- const name = decodeURI(url.slice(url[0]==='/' ? 1 : 0, i < 0 ? undefined : i))
68
+ const name = decodeURIComponent(url.slice(url[0]==='/' ? 1 : 0, i < 0 ? undefined : i))
69
if (!name)
70
return parent
71
const rest = i < 0 ? '' : url.slice(i+1, url.endsWith('/') ? -1 : undefined)