We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 202d32e commit 074fdd3Copy full SHA for 074fdd3
lib/http.js
@@ -861,7 +861,12 @@ function getTLS(options, callback) {
861
if (options.protocol && options.protocol !== "https:") {
862
throw new Error('This interface only supports https-schemed URLs');
863
}
864
- return (options.agent || exports.globalAgent).get(options, callback);
+ if (options.agent && typeof(options.agent.get) === 'function') {
865
+ var agentOptions = util._extend({}, options);
866
+ delete agentOptions.agent;
867
+ return options.agent.get(agentOptions, callback);
868
+ }
869
+ return exports.globalAgent.get(options, callback);
870
871
872
// Agent class
0 commit comments