From b6ef157e8e23d78705b5d7ec6d9f85f69e74e6e1 Mon Sep 17 00:00:00 2001 From: za-creature Date: Thu, 11 Apr 2013 23:35:21 +0300 Subject: [PATCH] Update connection-parameters.js --- lib/connection-parameters.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/connection-parameters.js b/lib/connection-parameters.js index aec183bb..df11d1cb 100644 --- a/lib/connection-parameters.js +++ b/lib/connection-parameters.js @@ -22,7 +22,9 @@ var parse = function(str) { var result = url.parse(str); var config = {}; config.host = result.hostname; - config.database = result.pathname ? result.pathname.slice(1) : null; + // not sure if postgres allows symbols in database names + // but we should allow them just in case + config.database = result.pathname ? decodeURI(result.pathname.slice(1)) : null; var auth = (result.auth || ':').split(':'); config.user = auth[0]; config.password = auth[1];