mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-23 20:53:15 -05:00
Server fixes when agent comes in with unknown agentid.
This commit is contained in:
parent
c3fc3a0d2a
commit
b15307ed6a
@ -141,7 +141,8 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We need to check if the core is current. Figure out what core we need.
|
// We need to check if the core is current. Figure out what core we need.
|
||||||
var corename;
|
var corename = null;
|
||||||
|
if (parent.parent.meshAgentsArchitectureNumbers[obj.agentInfo.agentId] != null) {
|
||||||
if (obj.agentCoreCheck == 1001) {
|
if (obj.agentCoreCheck == 1001) {
|
||||||
// If the user asked, use the recovery core.
|
// If the user asked, use the recovery core.
|
||||||
corename = parent.parent.meshAgentsArchitectureNumbers[obj.agentInfo.agentId].rcore;
|
corename = parent.parent.meshAgentsArchitectureNumbers[obj.agentInfo.agentId].rcore;
|
||||||
@ -152,6 +153,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||||||
// This is the normal core for this agent type.
|
// This is the normal core for this agent type.
|
||||||
corename = parent.parent.meshAgentsArchitectureNumbers[obj.agentInfo.agentId].core;
|
corename = parent.parent.meshAgentsArchitectureNumbers[obj.agentInfo.agentId].core;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we have a core, use it.
|
// If we have a core, use it.
|
||||||
if (corename != null) {
|
if (corename != null) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.3.6-o",
|
"version": "0.3.6-p",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
@ -1721,7 +1721,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
var urlArgs = '', urlName = null, splitUrl = req.originalUrl.split("?");
|
var urlArgs = '', urlName = null, splitUrl = req.originalUrl.split("?");
|
||||||
if (splitUrl.length > 1) { urlArgs = '?' + splitUrl[1]; }
|
if (splitUrl.length > 1) { urlArgs = '?' + splitUrl[1]; }
|
||||||
if ((splitUrl.length > 0) && (splitUrl[0].length > 1)) { urlName = splitUrl[0].substring(1).toLowerCase(); }
|
if ((splitUrl.length > 0) && (splitUrl[0].length > 1)) { urlName = splitUrl[0].substring(1).toLowerCase(); }
|
||||||
if ((urlName == null) || (domain.redirects[urlName] == null)) { res.sendStatus(404); return; }
|
if ((urlName == null) || (domain.redirects[urlName] == null) || (urlName[0] == '_')) { res.sendStatus(404); return; }
|
||||||
res.redirect(domain.redirects[urlName] + urlArgs + getQueryPortion(req));
|
res.redirect(domain.redirects[urlName] + urlArgs + getQueryPortion(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2743,7 +2743,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
obj.app.get(url + 'welcome.jpg', handleWelcomeImageRequest);
|
obj.app.get(url + 'welcome.jpg', handleWelcomeImageRequest);
|
||||||
|
|
||||||
// Server redirects
|
// Server redirects
|
||||||
if (parent.config.domains[i].redirects) { for (var j in parent.config.domains[i].redirects) { obj.app.get(url + j, handleDomainRedirect); } }
|
if (parent.config.domains[i].redirects) { for (var j in parent.config.domains[i].redirects) { if (j[0] != '_') { obj.app.get(url + j, handleDomainRedirect); } } }
|
||||||
|
|
||||||
// Server picture
|
// Server picture
|
||||||
obj.app.get(url + 'serverpic.ashx', function (req, res) {
|
obj.app.get(url + 'serverpic.ashx', function (req, res) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user