Skip to content

Commit

Permalink
Proper checking and handling of json bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Aug 13, 2011
1 parent 81e2c40 commit 76d8924
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 @@ -169,7 +169,7 @@ Request.prototype.request = function () {
if (options.json) {
options.headers['content-type'] = 'application/json'
if (typeof options.json === 'boolean') {
options.body = JSON.stringify(options.body)
if (typeof options.body === 'object') options.body = JSON.stringify(options.body)
} else {
options.body = JSON.stringify(options.json)
}
Expand Down

0 comments on commit 76d8924

Please sign in to comment.