diff --git a/package.json b/package.json index e7cdf11..0aaf1e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ft-poller", - "version": "1.0.0", + "version": "1.0.1", "repository": { "type": "git", "url": "https://github.com/Financial-Times/ft-poller" diff --git a/src/poller.js b/src/poller.js index 964097d..57d2695 100644 --- a/src/poller.js +++ b/src/poller.js @@ -70,7 +70,7 @@ Poller.prototype.fetch = function () { var latency = new Date() - time; if (response.statusCode === 200) { self.emit('ok', response, latency); - return JSON.parse(response.body); + return self.options.json ? response.body : JSON.parse(response.body); } else { throw response.body; }