mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
commit
add3dd1077
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user