mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Update connection-parameters.js
This commit is contained in:
parent
264839d3a9
commit
b6ef157e8e
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user