mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-31 17:53:40 -04:00
MeshRelay fix for #3118
This commit is contained in:
parent
f44faa67b4
commit
f918ae537c
@ -953,6 +953,9 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
|
|||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
// No routing needed. Just check permissions and fill in the device nodeid and meshid.
|
// 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) {
|
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
|
if (docs.length == 0) { console.log('ERR: Node not found'); try { obj.close(); } catch (e) { } return; } // Disconnect websocket
|
||||||
const node = docs[0];
|
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
|
// If there is a recording quota, remove any old recordings if needed
|
||||||
function cleanUpRecordings() {
|
function cleanUpRecordings() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user