From b0f44862ffe583bccf7157eb155438f74fd02265 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 16 Oct 2019 10:19:45 -0700 Subject: [PATCH] Fixed connection problem, server relay crash. --- MeshCentralServer.njsproj | 2 +- meshrelay.js | 3 +++ package.json | 2 +- .../{agent-redir-ws-0.1.0.js => agent-redir-ws-0.1.1.js} | 0 views/default-mobile.handlebars | 2 +- views/default.handlebars | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) rename public/scripts/{agent-redir-ws-0.1.0.js => agent-redir-ws-0.1.1.js} (100%) diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj index e1c50f24..b2aca8ab 100644 --- a/MeshCentralServer.njsproj +++ b/MeshCentralServer.njsproj @@ -126,7 +126,7 @@ - + diff --git a/meshrelay.js b/meshrelay.js index 33ec69b9..78ff55f3 100644 --- a/meshrelay.js +++ b/meshrelay.js @@ -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; } diff --git a/package.json b/package.json index 6b899bad..afa71b83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.2-p", + "version": "0.4.2-q", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/scripts/agent-redir-ws-0.1.0.js b/public/scripts/agent-redir-ws-0.1.1.js similarity index 100% rename from public/scripts/agent-redir-ws-0.1.0.js rename to public/scripts/agent-redir-ws-0.1.1.js diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 45461ff8..f11f6723 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -9,7 +9,7 @@ - + diff --git a/views/default.handlebars b/views/default.handlebars index f25fbe28..113945b3 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -22,7 +22,7 @@ - +