From 0e4787f3e8ca9b4428fcb63865ecd218ee7e1645 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Wed, 30 Jun 2021 13:42:56 +0100 Subject: [PATCH] Bump hpagent to 0.1.2 Also remove workaround for empty proxy credentials --- package.json | 2 +- .../@node-red/nodes/core/network/21-httprequest.js | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 92a4bce6a..cfe7660e0 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "fs.notify": "0.0.4", "got": "11.8.2", "hash-sum": "2.0.0", - "hpagent": "0.1.1", + "hpagent": "0.1.2", "https-proxy-agent": "5.0.0", "i18next": "20.3.2", "iconv-lite": "0.6.3", diff --git a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js index a498d4ac7..fd840bdea 100644 --- a/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js +++ b/packages/node_modules/@node-red/nodes/core/network/21-httprequest.js @@ -207,23 +207,17 @@ module.exports = function(RED) { } if (this.credentials) { if (this.authType === "basic") { - // Workaround for https://github.com/sindresorhus/got/issues/1169 - var cred = "" var parsedURL = new URL(url) if (this.credentials.user) { - // opts.username = this.credentials.user; - cred = this.credentials.user + opts.username = this.credentials.user; } else if (parsedURL.username) { - cred = parsedURL.username + opts.username = parsedURL.username } if (this.credentials.password) { - // opts.password = this.credentials.password; - cred += ":" + this.credentials.password + opts.password = this.credentials.password; } else if (parsedURL.password) { - cred += ":" + parsedURL.password + opts.password = parsedURL.password } - // build own basic auth header - opts.headers.Authorization = "Basic " + Buffer.from(cred).toString("base64"); } else if (this.authType === "digest") { let digestCreds = this.credentials; let sentCreds = false;