Skip to content

Commit

Permalink
http: Support legacy agent.addRequest API
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
isaacs committed Aug 7, 2013
1 parent d24decb commit 12cd133
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12cd133

Please sign in to comment.