fix: once aborted an upload, next attempt to upload the same file will fail
Massimo Melina committed
Dec 31, 2024 at 16:15 UTC
5e6645b0beb66075715631b0f768ae3b64bbb51e
1 file changed
+1
src/serveGuiAndSharedFiles.ts
+1
@@ -52,6 +52,7 @@ export const serveGuiAndSharedFiles: Koa.Middleware = async (ctx, next) => {
52
ctx.status = HTTP_SERVER_ERROR
53
ctx.body = err.message || String(err)
54
})
55
+ ctx.req.on('close', () => dest.end())
56
const uri = await dest.lockMiddleware // we need to wait more than just the stream
57
ctx.body = { uri }
58
}