Permalink
Browse files

should not break on xml even if we want json

  • Loading branch information...
1 parent 9ee40b2 commit 3c02635fb58d56d90c80962be68a8d3cd711fa45 @frozzare committed Oct 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/pinboard.js
View
@@ -299,8 +299,8 @@ var request = require('request'),
if (item.err) {
throw item.err;
} else if (item.res.statusCode == 200) {
- var data = item.format === 'json' ? eval('(' + item.body + ')') : item.body;
-
+ var data = item.format === 'json' && item.body[0] !== '<' ? eval('(' + item.body + ')') : item.body;
+
item.callback.call(this, data);
this.parseJSON = false;
}

0 comments on commit 3c02635

Please sign in to comment.