We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07137ab commit d51cd61Copy full SHA for d51cd61
2 files changed
lib/https.js
@@ -97,6 +97,9 @@ function createConnection(port, host, options) {
97
98
99
function Agent(options) {
100
+ if (!(this instanceof Agent))
101
+ return new Agent(options);
102
+
103
http.Agent.call(this, options);
104
this.defaultPort = 443;
105
this.protocol = 'https:';
test/parallel/test-https-agent-constructor.js
@@ -0,0 +1,7 @@
1
+'use strict';
2
+require('../common');
3
+const assert = require('assert');
4
+const https = require('https');
5
6
+assert.doesNotThrow(() => { https.Agent(); });
7
+assert.ok(https.Agent() instanceof https.Agent);
0 commit comments