Pass the Host header in http.cat calls, if it was specified in the URL passed to...
authorisaacs <i@foohack.com>
Tue, 29 Sep 2009 23:38:07 +0000 (16:38 -0700)
committerisaacs <i@foohack.com>
Tue, 29 Sep 2009 23:38:07 +0000 (16:38 -0700)
lib/http.js

index 0d7625c..097e8ce 100644 (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();