oembetter
Advanced tools
Comparing version 0.1.17 to 0.1.18
@@ -103,4 +103,4 @@ var request = require('request'); | ||
}, function(err, response, body) { | ||
if (err) { | ||
return callback(err); | ||
if (err || (response.statusCode >= 400)) { | ||
return callback(err || response.statusCode); | ||
} | ||
@@ -121,4 +121,8 @@ if (body[0] === '<') { | ||
} else { | ||
result = JSON.parse(body); | ||
return callback(null); | ||
try { | ||
result = JSON.parse(body); | ||
return callback(null); | ||
} catch (e) { | ||
return callback(e); | ||
} | ||
} | ||
@@ -125,0 +129,0 @@ }); |
{ | ||
"name": "oembetter", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "A modern oembed client. Allows you to register filters to improve or supply oembed support for sites that don't normally have it. You can also supply a whitelist of services you trust to prevent XSS attacks.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -188,2 +188,4 @@ # oembetter | ||
0.1.18: report HTTP errors properly rather than attempting to parse a nonexistent JSON body. Also, always try/catch when parsing JSON and report the exception as the callback error if necessary. | ||
0.1.17: Facebook oembed filter works regardless of whether Facebook's API has been initialized yet or not. | ||
@@ -190,0 +192,0 @@ |
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
33802
568
223