mongodb: encode username and password #560

This commit is contained in:
Jan Prochazka
2023-05-27 08:41:54 +02:00
parent 914d8dfe8a
commit 409278eca4

View File

@@ -60,7 +60,7 @@ const driver = {
mongoUrl = databaseUrl; mongoUrl = databaseUrl;
} }
} else { } else {
mongoUrl = user ? `mongodb://${user}:${password}@${server}:${port}` : `mongodb://${server}:${port}`; mongoUrl = user ? `mongodb://${encodeURIComponent(user)}:${encodeURIComponent(password)}@${server}:${port}` : `mongodb://${server}:${port}`;
} }
const options = { const options = {