Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[0.8.7/request] fixed bug in request with no body

  • Loading branch information...
commit d7f7a26328dc170394326d7d804acd11361502d2 1 parent 75d157d
@dscape authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 node_modules/request/main.js
  2. +1 −1  package.json
View
4 node_modules/request/main.js
@@ -314,7 +314,7 @@ Request.prototype.request = function () {
bodyLen += chunk.length
})
options.on("end", function () {
- if (Buffer.isBuffer(buffer[0])) {
+ if (buffer.length && Buffer.isBuffer(buffer[0])) {
var body = new Buffer(bodyLen)
var i = 0
buffer.forEach(function (chunk) {
@@ -322,7 +322,7 @@ Request.prototype.request = function () {
i += chunk.length
})
response.body = body.toString()
- } else {
+ } else if (buffer.length) {
response.body = buffer.join('')
}
View
2  package.json
@@ -2,7 +2,7 @@
, "description": "minimalistic couchdb driver for node.js"
, "homepage": "http://github.com/dscape/nano"
, "repository": "git://github.com/dscape/nano"
-, "version": "0.8.6"
+, "version": "0.8.7"
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "contributors": ["Thiago Arrais <thiago.arrais@gmail.com> (http://thiagoarrais.com)"]
, "keywords": ["couchdb", "data", "request", "json", "nosql", "micro", "nano"]
Please sign in to comment.
Something went wrong with that request. Please try again.