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
1 changed files with 2 additions and 2 deletions

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");