Skip to content

Commit b6ef157

Browse files
author
za-creature
committed
Update connection-parameters.js
1 parent 264839d commit b6ef157

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/connection-parameters.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ var parse = function(str) {
2222
var result = url.parse(str);
2323
var config = {};
2424
config.host = result.hostname;
25-
config.database = result.pathname ? result.pathname.slice(1) : null;
25+
// not sure if postgres allows symbols in database names
26+
// but we should allow them just in case
27+
config.database = result.pathname ? decodeURI(result.pathname.slice(1)) : null;
2628
var auth = (result.auth || ':').split(':');
2729
config.user = auth[0];
2830
config.password = auth[1];

0 commit comments

Comments
 (0)