Skip to content

Commit

Permalink
Fixed double var declaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jan 22, 2011
1 parent 34caf2e commit d604e03
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions request/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,17 @@ function request (options, callback) {
options.followRedirect = true;
}
options.method = options.method || 'GET';

options.headers = options.headers || {};

var setHost = false;
if (!options.headers.host) {
options.headers.host = options.uri.hostname;
if (options.uri.port) {
if ( !(options.uri.port === 80 && options.uri.protocol === 'http:') &&
!(options.uri.port === 443 && options.uri.protocol === 'https:') )
options.headers.host += (':'+options.uri.port);
}
var setHost = true;
} else {
var setHost = false;
setHost = true;
}

if (!options.uri.pathname) {options.uri.pathname = '/';}
Expand Down

0 comments on commit d604e03

Please sign in to comment.