1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

HTTP Basic Auth should always add : to username

fix for #3235
This commit is contained in:
Ben Hardill 2021-10-28 09:18:17 +01:00
parent cfe201dbe1
commit 87af31de20
No known key found for this signature in database
GPG Key ID: 74DD076979ABB1E7

View File

@ -302,11 +302,11 @@ in your Node-RED user directory (${RED.settings.userDir}).
var cred = ""
if (this.credentials.user) {
// opts.username = this.credentials.user;
cred = this.credentials.user
cred = this.credentials.user + ":"
}
if (this.credentials.password) {
// opts.password = this.credentials.password;
cred += ":" + this.credentials.password
cred += this.credentials.password
}
// build own basic auth header
opts.headers.Authorization = "Basic " + Buffer.from(cred).toString("base64");