We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e718495 commit f4a367aCopy full SHA for f4a367a
src/cmd-database-url.ts
@@ -16,14 +16,14 @@ async function resolveUrl(resourceName: string) {
16
17
let credentials = ''
18
if (dbInfo.credentials?.username) {
19
- credentials += dbInfo.credentials.username;
+ credentials += encodeURIComponent(dbInfo.credentials.username);
20
21
if (dbInfo.credentials.password) {
22
- credentials += ':' + dbInfo.credentials.password;
+ credentials += ':' + encodeURIComponent(dbInfo.credentials.password);
23
}
24
25
26
- return `mongodb://${credentials}@${dbInfo.host}:${dbInfo.port}/${dbName}?authSource=admin&directConnection=true`;
+ return `mongodb://${credentials}@${dbInfo.host}:${dbInfo.port}/${encodeURIComponent(dbName)}?authSource=admin&directConnection=true`;
27
28
29
if (!process.argv[2]) {
0 commit comments