Skip to content

Commit

Permalink
allow empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
benatkin committed Aug 2, 2011
1 parent 68c17f6 commit 1cb1ec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Request.prototype.request = function () {
})
options.on("end", function () {
response.body = buffer
if (options.json && response.headers['content-type'] === 'application/json') {
if (options.json && response.headers['content-type'] === 'application/json' && response.body != '') {
response.body = JSON.parse(response.body)
}
options.callback(null, response, response.body)
Expand Down

0 comments on commit 1cb1ec1

Please sign in to comment.