mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
http: Support legacy agent.addRequest API
There are some agent subclasses using this today. Despite the addRequest function being undocumented internal API, it's easy enough to just support the old signature for backwards compatibility.
This commit is contained in:
@@ -128,6 +128,15 @@ Agent.prototype.getName = function(options) {
|
||||
};
|
||||
|
||||
Agent.prototype.addRequest = function(req, options) {
|
||||
// Legacy API: addRequest(req, host, port, path)
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
host: options,
|
||||
port: arguments[2],
|
||||
path: arguments[3]
|
||||
};
|
||||
}
|
||||
|
||||
var host = options.host;
|
||||
var port = options.port;
|
||||
var localAddress = options.localAddress;
|
||||
|
||||
Reference in New Issue
Block a user