Skip to content

Commit

Permalink
Lint annoys me in sublime
Browse files Browse the repository at this point in the history
  • Loading branch information
nijikokun committed Apr 3, 2013
1 parent 27ccec6 commit a4182e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/oauth.js
Expand Up @@ -290,18 +290,20 @@ OAuth.prototype.performSecureRequest = function (options, callback) {
if (called) return; else called = true;
if (response.statusCode >= 200 && response.statusCode <= 299)
callback(null, data, response);
else if ((response.statusCode == 301 || response.statusCode == 302) && response.headers && response.headers.location)
else if ((response.statusCode == 301 || response.statusCode == 302) && response.headers && response.headers.location) {
options.url = response.headers.location,
$this.performSecureRequest(options, callback);
else
} else
callback({ statusCode: response.statusCode, data: data }, data, response);
};

request.on('response', function (response) {
if ($this.clientOptions.detectResponseContentType && utils.isBinaryContent(response))
data = new Buffer(0), binary = true;
else
response.setEncoding('utf8'), data = "";
if ($this.clientOptions.detectResponseContentType && utils.isBinaryContent(response)) {
data = new Buffer(0),
binary = true;
} else
response.setEncoding('utf8'),
data = "";

response.on('data', function (chunk) { if (binary) data = Buffer.concat([data, chunk]); else data += chunk; });
response.on('close', function () { if (earlyClose) respond(response); });
Expand Down

0 comments on commit a4182e8

Please sign in to comment.