mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Better fix
This commit is contained in:
		@@ -298,18 +298,14 @@ in your Node-RED user directory (${RED.settings.userDir}).
 | 
			
		||||
            }
 | 
			
		||||
            if (Object.keys(this.credentials).length != 0) {
 | 
			
		||||
                if (this.authType === "basic") {
 | 
			
		||||
                    // Workaround for https://github.com/sindresorhus/got/issues/1169
 | 
			
		||||
                    var cred = ""
 | 
			
		||||
                    if (this.credentials.user) {
 | 
			
		||||
                        // opts.username = this.credentials.user;
 | 
			
		||||
                        cred = this.credentials.user + ":"
 | 
			
		||||
                    }
 | 
			
		||||
                    if (this.credentials.password) {
 | 
			
		||||
                        // opts.password = this.credentials.password;
 | 
			
		||||
                        cred += this.credentials.password
 | 
			
		||||
                    // Workaround for https://github.com/sindresorhus/got/issues/1169 (fixed in got v12)
 | 
			
		||||
                    // var cred = ""
 | 
			
		||||
                    if (this.credentials.user || this.credentials.password) {
 | 
			
		||||
                        // cred = `${this.credentials.user}:${this.credentials.password}`;
 | 
			
		||||
                        opts.headers.Authorization = "Basic " + Buffer.from(`${this.credentials.user}:${this.credentials.password}`).toString("base64");
 | 
			
		||||
                    }
 | 
			
		||||
                    // build own basic auth header
 | 
			
		||||
                    opts.headers.Authorization = "Basic " + Buffer.from(cred).toString("base64");
 | 
			
		||||
                    // opts.headers.Authorization = "Basic " + Buffer.from(cred).toString("base64");
 | 
			
		||||
                } else if (this.authType === "digest") {
 | 
			
		||||
                    let digestCreds = this.credentials;
 | 
			
		||||
                    let sentCreds = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user