mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
Empty meta fix for querying new slave check
This commit is contained in:
1 parent
b956438d8d
commit
3338c439dd
1 file changed
+7
-4
@@ -379,17 +379,20 @@ POST Get metadata from a single slave. For whenever you find the data returned b
|
||||
app.post("/api/getSlaveMeta", function (req, res) {
|
||||
endpointHitCounter.labels(req.route.path).inc();
|
||||
console.log("body", req.body);
|
||||
if(req.body && req.body.instanceID){
|
||||
if (slaves[req.body.instanceID]) {
|
||||
if(req.body && req.body.instanceID){
|
||||
if (slaves[req.body.instanceID]) {
|
||||
console.log("returning meta for ", req.body.instanceID);
|
||||
if(!slaves[req.body.instanceID].meta) {
|
||||
slaves[req.body.instanceID].meta = {};
|
||||
}
|
||||
res.send(JSON.stringify(slaves[req.body.instanceID].meta))
|
||||
} else {
|
||||
res.status(404)
|
||||
res.send('{"status": 404, "info": "Slave not registered"}')
|
||||
}
|
||||
} else {
|
||||
res.status(400);
|
||||
res.send('{"INVALID_REQUEST":1}');
|
||||
res.status(400);
|
||||
res.send('{"INVALID_REQUEST":1}');
|
||||
}
|
||||
});
|
||||
// mod management
|
||||
|
||||
Reference in new issue
Block a user