Comparing version 3.0.0 to 3.0.1
19
gdata.js
@@ -7,4 +7,2 @@ var EventEmitter = require('events').EventEmitter; | ||
var URL = require('url'); | ||
var oauthBase = 'https://accounts.google.com/o/oauth2'; | ||
@@ -24,3 +22,12 @@ | ||
httpsRes.on('data', function (data) { | ||
callback(null, JSON.parse(data.toString())); | ||
var res; | ||
try { | ||
res = JSON.parse(data.toString()); | ||
} catch(err) { | ||
return callback({ | ||
err: err, | ||
res: data | ||
}); | ||
} | ||
callback(null, res); | ||
}); | ||
@@ -99,3 +106,3 @@ } else { | ||
return token; | ||
} | ||
}; | ||
@@ -137,4 +144,4 @@ client.getFeed = function (url, params, callback) { | ||
return callback(null, body); | ||
}) | ||
} | ||
}); | ||
}; | ||
@@ -141,0 +148,0 @@ function doRequest(url, params, callback) { |
{ | ||
"name": "gdata-js", | ||
"description": "Simple OAuth 2.0 GData API client", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": "Simon Murtha-Smith <simon@murtha-smith.com>", | ||
@@ -6,0 +6,0 @@ "keywords": ["google", "gdata"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9311
246