fix: upload failed if done in a folder named %1

Massimo Melina committed Jun 9, 2024 at 23:57 UTC f1f4c260e32b0791805b662daf7851a881b693d0
1 file changed +1 -1
src/serveGuiAndSharedFiles.ts
+1 -1
@@ -42,7 +42,7 @@ export const serveGuiAndSharedFiles: Koa.Middleware = async (ctx, next) => {
42 if (ctx.method === 'PUT') { // curl -T file url/
43 const decPath = decodeURIComponent(path)
44 let rest = basename(decPath)
45 - const folder = await urlToNode(dirname(decPath), ctx, vfs, v => rest = v+'/'+rest)
45 + const folder = await urlToNode(dirname(path), ctx, vfs, v => rest = v+'/'+rest)
46 if (!folder)
47 return sendErrorPage(ctx, HTTP_NOT_FOUND)
48 ctx.state.uploadPath = decPath