From 8eaa1ee4a97fbe081de8b0197292ceea3d802c44 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 2 Nov 2021 19:45:36 -0700 Subject: [PATCH] MeshCMD Route missing HTTP host header fix. --- agents/meshcmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 48bd731a..775b7445 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -2034,9 +2034,9 @@ function startRouter() { if (xtoken != null) { xurlargs.push('token=' + xtoken); } } else { if (xtoken != null) { - options.headers = { 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') + ',' + Buffer.from(xtoken, 'binary').toString('base64') }; + options.headers = { 'host': options.host, 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') + ',' + Buffer.from(xtoken, 'binary').toString('base64') }; } else { - options.headers = { 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') }; + options.headers = { 'host': options.host, 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') }; } } } else { options.headers = { 'x-meshauth': '*' }; } // Request inner authentication