MeshCMD Route missing HTTP host header fix.

This commit is contained in:
Ylian Saint-Hilaire 2021-11-02 19:45:36 -07:00
parent 97bd723e4e
commit 8eaa1ee4a9

View File

@ -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