Browse files

[dist] 1.3.3

* minor fix to url concat
* fixes #56
* thanks @shimaore
  • Loading branch information...
1 parent 0000c1e commit 750fda15f2dc3051cc7ef481642e18c39ba85e87 @dscape committed Feb 19, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −0 logging.js
  2. +1 −1 nano.js
  3. +2 −1 package.json
  4. +3 −0 tests/shared/cfg.js
View
1 logging.js
@@ -3,6 +3,7 @@
var verbose = (process.env.NANO_ENV==='testing');
// snippet by Marak Squires.
+// MIT Licenced, Nodejitsu
function randomString(len, charSet) {
charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var str = '';
View
2 nano.js
@@ -645,7 +645,7 @@ module.exports = exports = nano = function database_module(cfg) {
if(path.pathname && path_array.length > 0) {
auth = path.auth ? path.auth + '@' : '';
db = path_array[0];
- cfg.url = path.protocol + '//' + auth + path.hostname; // reset url
+ cfg.url = u.format({protocol:path.protocol,host:path.host});
return document_module(db);
}
else { return public_functions; }
View
3 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" : "1.3.2"
+, "version" : "1.3.3"
, "author" : "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "contributors" :
[ "Thiago Arrais <thiago.arrais@gmail.com> (http://thiagoarrais.com)"
@@ -14,6 +14,7 @@
, "Dale Harvey <dale@arandomurl.com> (http://arandomurl.com)"
, "Jan Lehnardt <jan@apache.org> (http://jan.prima.de/plok/)"
, "InTheFiveByFive"
+ , "Stéphane Alnet <stephane@shimaore.net> (http://blog.shimaore.net)"
]
, "keywords" :
["couchdb", "data", "request", "json", "nosql", "micro", "nano", "database"]
View
3 tests/shared/cfg.js
@@ -46,6 +46,9 @@ tests.url_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com")
tests.url2 = function (callback) { callback(null,nano('http://someurl.com/')); };
tests.url2_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com/"); };
+tests.url3 = function (callback) { callback(null,nano('http://someurl.com:5984/a')); };
+tests.url3_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com:5984"); };
+
tests.url_db = function (callback) { nano(cfg.url + "/adb").info(callback); };
tests.url_db_ok = function (e,b) {
this.t.equal(e.message,"no_db_file");

0 comments on commit 750fda1

Please sign in to comment.