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