mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix for basic auth with @ in username
This commit is contained in:
parent
4acb66fb7a
commit
bcb6d1cf93
@ -207,12 +207,18 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
if (this.credentials) {
|
if (this.credentials) {
|
||||||
if (this.authType === "basic") {
|
if (this.authType === "basic") {
|
||||||
|
var cred = ""
|
||||||
if (this.credentials.user) {
|
if (this.credentials.user) {
|
||||||
opts.username = this.credentials.user;
|
// opts.username = this.credentials.user;
|
||||||
|
cred = this.credentials.user
|
||||||
}
|
}
|
||||||
if (this.credentials.password) {
|
if (this.credentials.password) {
|
||||||
opts.password = this.credentials.password;
|
// opts.password = this.credentials.password;
|
||||||
|
cred += ":" + this.credentials.password
|
||||||
}
|
}
|
||||||
|
// build own basic auth header
|
||||||
|
// Workaround for https://github.com/sindresorhus/got/issues/1169
|
||||||
|
opts.headers.Authorization = "Basic " + Buffer.from(cred).toString("base64");
|
||||||
} else if (this.authType === "digest") {
|
} else if (this.authType === "digest") {
|
||||||
let digestCreds = this.credentials;
|
let digestCreds = this.credentials;
|
||||||
let sentCreds = false;
|
let sentCreds = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user