1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed connection problem, server relay crash.

This commit is contained in:
Ylian Saint-Hilaire 2019-10-16 10:19:45 -07:00
parent 51095271de
commit 36aa0bbba7
6 changed files with 7 additions and 4 deletions

View file

@ -27,6 +27,9 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain, user, cookie
if (rcookie.ruserid != null) { obj.ruserid = rcookie.ruserid; }
}
// Check connection id
if (obj.id == null) { try { ws.close(); parent.parent.debug('relay', 'Relay: Connection with no id (' + cleanRemoteAddr(req.ip) + ')'); } catch (e) { console.log(e); } return; }
// If there is no authentication, drop this connection
if ((obj.id.startsWith('meshmessenger/') == false) && (obj.user == null) && (obj.ruserid == null)) { try { ws.close(); parent.parent.debug('relay', 'Relay: Connection with no authentication (' + cleanRemoteAddr(req.ip) + ')'); } catch (e) { console.log(e); } return; }