mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +09:00
Might have fixed bug related to mod uploads
This commit is contained in:
1 parent
447766c752
commit
010e5271ea
1 file changed
+5
-5
@@ -415,10 +415,7 @@ POST endpoint for uploading mods to the master server. Required for automatic mo
|
|||||||
app.post("/api/uploadMod", authenticate.middleware, function(req,res) {
|
app.post("/api/uploadMod", authenticate.middleware, function(req,res) {
|
||||||
endpointHitCounter.labels(req.route.path).inc();
|
endpointHitCounter.labels(req.route.path).inc();
|
||||||
let reqStartTime = Date.now();
|
let reqStartTime = Date.now();
|
||||||
if (!req.files) {
|
if (req.files && req.files.file) {
|
||||||
res.send('No files were uploaded.');
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
console.log(req.files.file);
|
console.log(req.files.file);
|
||||||
req.files.file.mv('./database/masterMods/'+req.files.file.name, function(err) {
|
req.files.file.mv('./database/masterMods/'+req.files.file.name, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -429,7 +426,10 @@ app.post("/api/uploadMod", authenticate.middleware, function(req,res) {
|
|||||||
}
|
}
|
||||||
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
res.send('No files were uploaded.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
GET endpoint for getting information about all our slaves
|
GET endpoint for getting information about all our slaves
|
||||||
|
|||||||
Reference in new issue
Block a user