diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 1db331c3d12aa6..c18f39a38c6e2d 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -94,19 +94,16 @@ Agent.prototype.createConnection = net.createConnection; // Get the key for a given set of request options Agent.prototype.getName = function(options) { - var name = ''; - - if (options.host) - name += options.host; - else - name += 'localhost'; + var name = options.host || 'localhost'; name += ':'; if (options.port) name += options.port; + name += ':'; if (options.localAddress) name += options.localAddress; + return name; };