diff options
author | cjihrig <cjihrig@gmail.com> | 2017-05-09 14:32:34 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-05-11 15:28:27 -0400 |
commit | 9ce2271e813016685d1c8f9ab3e7ce6c85eee069 (patch) | |
tree | 2ba9b874dda7953030ff307f7461c3e9028539a6 /lib/https.js | |
parent | abfd4bf9dfbf4e9817fe2c0b08476f505c4012d1 (diff) | |
download | android-node-v8-9ce2271e813016685d1c8f9ab3e7ce6c85eee069.tar.gz android-node-v8-9ce2271e813016685d1c8f9ab3e7ce6c85eee069.tar.bz2 android-node-v8-9ce2271e813016685d1c8f9ab3e7ce6c85eee069.zip |
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>
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js index c44766bd6e..1ca546ac10 100644 --- a/lib/https.js +++ b/lib/https.js @@ -119,6 +119,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:'; |