check if connected to vm before uploading
This commit is contained in:
parent
53f065b630
commit
136b2bed4b
1 changed files with 4 additions and 0 deletions
|
@ -80,6 +80,10 @@ app.put("/:vm/:filename", async (req, res) => {
|
|||
res.status(400);
|
||||
return { success: false, result: "Filename contains disallowed characters" };
|
||||
}
|
||||
if (!VMs.get(vm)!.isConnectedToVM) {
|
||||
res.status(503);
|
||||
return { success: false, result: "Not connected to VM (make sure the agent is running)" };
|
||||
}
|
||||
if (IPs.has(req.ip)) {
|
||||
if (!IPs.get(req.ip)!.Limit()) {
|
||||
res.status(429);
|
||||
|
|
Loading…
Reference in a new issue