Permalink
Browse files

update

  • Loading branch information...
Andris Reinman
Andris Reinman committed Sep 28, 2012
1 parent ac6979b commit d46873a799453c030389c3b32be4f9fd7dd4c57d
Showing 906 changed files with 765,458 additions and 7 deletions.
View
@@ -48,7 +48,7 @@ function FetchStream(url, options){
return this.emit("error", new Error("url not defined"));
}
- this.userAgent = "FetchStream";
+ this.userAgent = options.userAgent || "FetchStream";
this._redirect_count = 0;
@@ -134,7 +134,7 @@ FetchStream.prototype.parseUrl = function(url){
var urlparts = urllib.parse(url, false, true),
transport,
urloptions = {
- host: urlparts.hostname,
+ host: urlparts.hostname || urlparts.host,
port: urlparts.port,
path: urlparts.pathname + (urlparts.search || "") || "/",
method: this.options.method
@@ -243,18 +243,16 @@ FetchStream.prototype.runStream = function(url){
url_data.urloptions.headers['content-length'] = this.options.payloadSize;
}
- url_data.urloptions.agent = this.options.agent;
-
if (this.options.asyncDnsLoookup) {
var dnsCallback = (function (err, adresses){
if (err) {
this.emit("error", err);
return;
}
- url_data.urloptions.headers['host'] = url_data.urloptions.hostname+url_data.urloptions.port;
+ url_data.urloptions.headers['host'] = url_data.urloptions.hostname || url_data.urloptions.host;
url_data.urloptions.hostname = adresses[0];
- url_data.urloptions.host=url_data.urloptions.hostname + (url_data.urloptions.port? ':' + url_data.urloptions.port: '');
+ url_data.urloptions.host = url_data.urloptions.headers['host'] + (url_data.urloptions.port? ':' + url_data.urloptions.port: '');
this._runStream(url_data, url);
}).bind(this);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit d46873a

Please sign in to comment.