Skip to content

Commit

Permalink
Merge pull request #1716 from calibr/iojs-error-fix
Browse files Browse the repository at this point in the history
Do not create Buffer from Object in setContentLength(iojs v3.0 issue)
  • Loading branch information
simov committed Aug 10, 2015
2 parents 94536b4 + ea39c23 commit 30c7df5
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 30c7df5

Please sign in to comment.