0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Pass the Host header in http.cat calls, if it was specified in the URL passed to http.cat.

This commit is contained in:
isaacs 2009-09-29 16:38:07 -07:00
parent a8c0211e73
commit 45f5402446

View File

@ -555,7 +555,7 @@ exports.cat = function (url, encoding) {
var uri = exports.parseUri(url);
var client = exports.createClient(uri.port || 80, uri.host);
var req = client.get(uri.path || "/");
var req = client.get(uri.path || "/", uri.host ? {"Host" : uri.host} : {});
client.addListener("error", function () {
promise.emitError();