https: support agent construction without new

Fixes: https://github.com/nodejs/node/issues/12918
PR-URL: https://github.com/nodejs/node/pull/12927
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
cjihrig authored and Myles Borins committed 2017-07-17 10:18:01 -04:00
1 parent 07137ab4db
commit d51cd61713
2 files changed
+10

No files matched your search

+3
View File
@@ -97,6 +97,9 @@ function createConnection(port, host, options) {
function Agent(options) {
if (!(this instanceof Agent))
return new Agent(options);
http.Agent.call(this, options);
this.defaultPort = 443;
this.protocol = 'https:';