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 00226d3fd..bc434f453 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 @@ -364,7 +364,7 @@ module.exports = function(RED) { proxyOptions.proxy.password = proxyPassword; } } - //need both incase of http -> https redirec + //need both incase of http -> https redirect opts.agent = { http: new HttpProxyAgent(proxyOptions), https: new HttpsProxyAgent(proxyOptions) @@ -385,13 +385,7 @@ module.exports = function(RED) { got(url,opts).then(res => { msg.statusCode = res.statusCode; msg.headers = res.headers; - let hostname = res.req.host; - if (res.req.protocol === "http:" && res.socket.remotePort !== 80) { - hostname = `${hostname}:${res.socket.remotePort}` - } else if (res.req.protocol === "https:" && res.socket.remotePort !== 443) { - hostname = `${hostname}:${res.socket.remotePort}` - } - msg.responseUrl = `${res.req.protocol}//${hostname}${res.req.path}`; + msg.responseUrl = res.url; msg.payload = res.body; msg.redirectList = redirectList; msg.retry = 0;