0.5.7: Fixed bug with pipe
diff --git a/nano.js b/nano.js
index 1c016c3..bbfaa36 100644
--- a/nano.js
+++ b/nano.js
@@ -82,15 +82,15 @@
if(opts.att) { url += "/" + opts.att; } // add the attachment to the url
}
if(opts.content_type) { req.headers["content-type"] = opts.content_type; }
+ if(opts.encoding) { req.encoding = opts.encoding; }
+ req.uri = url + (_.isEmpty(params) ? "" : "?" + qs.stringify(params));
+ if(!callback) { return request(req); } // void callback, pipe
if(opts.body) {
if (Buffer.isBuffer(opts.body)) {
req.body = opts.body; // raw data
}
else { req.body = JSON.stringify(opts.body); } // json data
}
- if(opts.encoding) { req.encoding = opts.encoding; }
- req.uri = url + (_.isEmpty(params) ? "" : "?" + qs.stringify(params));
- if(!callback) { return request(req); } // void callback
request(req, function(e,h,b){
if(e) { return callback(error.request_err(e,"socket",req,status_code),{},b); }
rh = (h.headers || {});
diff --git a/package.json b/package.json
index 17eff3b..9c32635 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{ "name": "nano"
, "description": "minimalistic couchdb driver for node.js"
, "homepage": "http://github.com/dscape/nano"
-, "version": "0.5.6"
+, "version": "0.5.7"
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "keywords": ["couchdb", "data", "request", "json", "nosql", "micro", "nano"]
, "dependencies": {"request": "~2.0.5", "underscore": "~1.1.7"}