Skip to content

Commit 45f5402

Browse files
author
isaacs
committed
Pass the Host header in http.cat calls, if it was specified in the URL passed to http.cat.
1 parent a8c0211 commit 45f5402

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ exports.cat = function (url, encoding) {
555555

556556
var uri = exports.parseUri(url);
557557
var client = exports.createClient(uri.port || 80, uri.host);
558-
var req = client.get(uri.path || "/");
558+
var req = client.get(uri.path || "/", uri.host ? {"Host" : uri.host} : {});
559559

560560
client.addListener("error", function () {
561561
promise.emitError();

0 commit comments

Comments
 (0)