http: default Agent.getName to 'localhost' · nodejs/node@431bf74

Original file line numberDiff line numberDiff line change

@@ -94,19 +94,16 @@ Agent.prototype.createConnection = net.createConnection;

9494
9595

// Get the key for a given set of request options

9696

Agent.prototype.getName = function(options) {

97-

var name = '';

98-
99-

if (options.host)

100-

name += options.host;

101-

else

102-

name += 'localhost';

97+

var name = options.host || 'localhost';

10398
10499

name += ':';

105100

if (options.port)

106101

name += options.port;

102+
107103

name += ':';

108104

if (options.localAddress)

109105

name += options.localAddress;

106+
110107

return name;

111108

};

112109