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 = {