mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Expose agent in http and https client.
This commit is contained in:
@@ -59,8 +59,12 @@ exports.getAgent = getAgent;
|
||||
|
||||
|
||||
exports.request = function(options, cb) {
|
||||
var agent = getAgent(options);
|
||||
return http._requestFromAgent(agent, options, cb);
|
||||
if (options.agent === undefined) {
|
||||
options.agent = getAgent(options);
|
||||
} else if (options.agent === false) {
|
||||
options.agent = new Agent(options);
|
||||
}
|
||||
return http._requestFromAgent(options, cb);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user