Skip to content

Commit 77daa06

Browse files
francoispbrianc
authored andcommitted
use encodeURI instead of string replace
1 parent 8d103cf commit 77daa06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/connection-parameters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var parse = function(str) {
1717
return { host: str };
1818
}
1919
// url parse expects spaces encoded as %20
20-
str = str.replace(' ', '%20');
20+
str = encodeURI(str);
2121
var result = url.parse(str);
2222
var config = {};
2323
config.host = result.hostname;

0 commit comments

Comments
 (0)