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 daa7e05 commit 202d32eCopy full SHA for 202d32e
lib/http.js
@@ -834,7 +834,12 @@ function requestTLS(options, callback) {
834
if (options.protocol && options.protocol !== "https:") {
835
throw new Error('This interface only supports https-schemed URLs');
836
}
837
- return (options.agent || exports.globalAgent).request(options, callback);
+ if (options.agent && typeof(options.agent.request) === 'function') {
838
+ var agentOptions = util._extend({}, options);
839
+ delete agentOptions.agent;
840
+ return options.agent.request(agentOptions, callback);
841
+ }
842
+ return exports.globalAgent.request(options, callback);
843
844
845
function getRaw(options, callback) {
0 commit comments