Browse files

Lint annoys me in sublime

  • Loading branch information...
1 parent 27ccec6 commit a4182e8bca52b9484550fd0fcc70a5274c6b2d06 @nijikokun nijikokun committed Apr 2, 2013
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/oauth.js
View
14 lib/oauth.js
@@ -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); });

0 comments on commit a4182e8

Please sign in to comment.