|
@ -663,7 +663,7 @@ function Client ( ) { |
|
|
|
|
|
|
|
|
self.addListener("connect", function () { |
|
|
self.addListener("connect", function () { |
|
|
if (this.https) { |
|
|
if (this.https) { |
|
|
this.setSecure(this.credentials); |
|
|
this.setSecure(this.credentials); |
|
|
} else { |
|
|
} else { |
|
|
parser.reinitialize('response'); |
|
|
parser.reinitialize('response'); |
|
|
debug('requests: ' + sys.inspect(requests)); |
|
|
debug('requests: ' + sys.inspect(requests)); |
|
@ -780,7 +780,7 @@ exports.cat = function (url, encoding_, headers_) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var url = require("url").parse(url); |
|
|
var url = require("url").parse(url); |
|
|
|
|
|
|
|
|
var hasHost = false; |
|
|
var hasHost = false; |
|
|
if (headers instanceof Array) { |
|
|
if (headers instanceof Array) { |
|
|
for (var i = 0, l = headers.length; i < l; i++) { |
|
|
for (var i = 0, l = headers.length; i < l; i++) { |
|
@ -802,7 +802,7 @@ exports.cat = function (url, encoding_, headers_) { |
|
|
if (!hasHost) headers["Host"] = url.hostname; |
|
|
if (!hasHost) headers["Host"] = url.hostname; |
|
|
|
|
|
|
|
|
var content = ""; |
|
|
var content = ""; |
|
|
|
|
|
|
|
|
var client = exports.createClient(url.port || 80, url.hostname); |
|
|
var client = exports.createClient(url.port || 80, url.hostname); |
|
|
var req = client.request((url.pathname || "/")+(url.search || "")+(url.hash || ""), headers); |
|
|
var req = client.request((url.pathname || "/")+(url.search || "")+(url.hash || ""), headers); |
|
|
|
|
|
|
|
|