Return Error is the archive is not uploaded correctly.

This commit is contained in:
2022-10-05 13:04:04 +03:00
parent 50501b05c6
commit 804c504c06
+6
View File
@@ -120,6 +120,12 @@ app.get('/publish', async (req, res) => {
body, body,
headers: {'Content-Type': 'application/zip'} headers: {'Content-Type': 'application/zip'}
}); });
if (response.status !== 200) {
res.json({success: false, message: "Can't upload the archive, permissions error."});
await fs.unlink('./dist.zip');
return;
}
} }
res.json({success: true}); res.json({success: true});