1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-02-12 11:01:52 +00:00

MeshRelay fix for #3118

This commit is contained in:
Ylian Saint-Hilaire 2021-09-10 12:20:34 -07:00
parent f44faa67b4
commit f918ae537c

View file

@ -953,6 +953,9 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
return obj;
} else {
// No routing needed. Just check permissions and fill in the device nodeid and meshid.
if ((obj.req.query.nodeid != null) && (obj.req.query.nodeid.startsWith('node/'))) {
var nodeSplit = obj.req.query.nodeid.split('/');
if ((nodeSplit.length != 3) || (nodeSplit[1] != domain.id)) { console.log('ERR: Invalid NodeID'); try { obj.close(); } catch (e) { } return; }
parent.db.Get(obj.req.query.nodeid, function (err, docs) {
if (docs.length == 0) { console.log('ERR: Node not found'); try { obj.close(); } catch (e) { } return; } // Disconnect websocket
const node = docs[0];
@ -966,6 +969,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
});
}
}
}
// If there is a recording quota, remove any old recordings if needed
function cleanUpRecordings() {