Skip to content

Commit

Permalink
do not create Buffer from Object in setContentLength
Browse files Browse the repository at this point in the history
  • Loading branch information
calibr committed Aug 5, 2015
1 parent 7a42a98 commit ea39c23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request.js
Expand Up @@ -432,7 +432,7 @@ Request.prototype.init = function (options) {
}

function setContentLength () {
if (!Buffer.isBuffer(self.body) && !Array.isArray(self.body)) {
if (!Buffer.isBuffer(self.body) && !Array.isArray(self.body) && typeof self.body !== 'object') {
self.body = new Buffer(self.body)
}
if (!self.hasHeader('content-length')) {
Expand Down

0 comments on commit ea39c23

Please sign in to comment.