mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add fix for HttpsProxyAgent using an incorrect default port for http:
This commit is contained in:
		| @@ -88,8 +88,13 @@ module.exports = function(RED) { | ||||
|             if (msg.method && n.method && (n.method === "use")) { | ||||
|                 method = msg.method.toUpperCase();          // use the msg parameter | ||||
|             } | ||||
|  | ||||
|             var isHttps = (/^https/.test(url)); | ||||
|  | ||||
|             var opts = {}; | ||||
|             opts.url = url; | ||||
|             // set defaultport, else when using HttpsProxyAgent, it's defaultPort of 443 will be used :(. | ||||
|             opts.defaultPort = isHttps?443:80; | ||||
|             opts.timeout = node.reqTimeout; | ||||
|             opts.method = method; | ||||
|             opts.headers = {}; | ||||
| @@ -284,6 +289,7 @@ module.exports = function(RED) { | ||||
|                 opts.headers[clSet] = opts.headers['content-length']; | ||||
|                 delete opts.headers['content-length']; | ||||
|             } | ||||
|              | ||||
|             var noproxy; | ||||
|             if (noprox) { | ||||
|                 for (var i in noprox) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user