From fe478c6b5ddf2b7ec7b2763eb2e767cd8c8baddf Mon Sep 17 00:00:00 2001 From: michalkot Date: Wed, 15 May 2013 12:41:18 +0100 Subject: [PATCH] do not append a shash on empty paths --- lib/couchdb.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/couchdb.js b/lib/couchdb.js index 72d61e6..20f26f8 100644 --- a/lib/couchdb.js +++ b/lib/couchdb.js @@ -141,7 +141,12 @@ CouchDB.prototype.deleteDB = function (callback) { CouchDB.prototype.client = function (method, path, data, callback) { var pathname = this.instance.pathname; - path = (pathname ? pathname + '/' + path : '/' + path); + if (pathname && !path) { + path = pathname; + } + else { + path = (pathname ? pathname + '/' + path : '/' + path); + } path = path.replace(/^\/\/+/, '/'); var headers = {