MeshCMD Route missing HTTP host header fix.
Ylian Saint-Hilaire committed
Nov 2, 2021 at 19:45 UTC
8eaa1ee4a97fbe081de8b0197292ceea3d802c44
1 file changed
+2
-2
agents/meshcmd.js
+2
-2
@@ -2034,9 +2034,9 @@ function startRouter() {
2034
if (xtoken != null) { xurlargs.push('token=' + xtoken); }
2035
} else {
2036
if (xtoken != null) {
2037
- options.headers = { 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') + ',' + Buffer.from(xtoken, 'binary').toString('base64') };
2037
+ 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') };
2038
} else {
2039
- options.headers = { 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') };
2039
+ options.headers = { 'host': options.host, 'x-meshauth': Buffer.from(settings.username, 'binary').toString('base64') + ',' + Buffer.from(settings.password, 'binary').toString('base64') };
2040
}
2041
}
2042
} else { options.headers = { 'x-meshauth': '*' }; } // Request inner authentication