mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
use encodeURI instead of string replace
This commit is contained in:
parent
8d103cf893
commit
77daa06df9
@ -17,7 +17,7 @@ var parse = function(str) {
|
||||
return { host: str };
|
||||
}
|
||||
// url parse expects spaces encoded as %20
|
||||
str = str.replace(' ', '%20');
|
||||
str = encodeURI(str);
|
||||
var result = url.parse(str);
|
||||
var config = {};
|
||||
config.host = result.hostname;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user