From 1a6fee8cdc4222b46b8f4c447a6949d020b7d8ea Mon Sep 17 00:00:00 2001 From: DiegoVictor Date: Wed, 10 Jul 2024 18:41:03 -0300 Subject: [PATCH] Encode password before use it --- src/migrations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/migrations.js b/src/migrations.js index 06bf61d..a8552c1 100644 --- a/src/migrations.js +++ b/src/migrations.js @@ -5,7 +5,8 @@ module.exports.handler = async () => { const { username, password } = await secretManager.getSecret( process.env.CLUSTER_SECRET_ID ); - const DATABASE_URL = `postgresql://${username}:${password}@${process.env.CLUSTER_URL}/coderunner?schema=public`; + const pass = encodeURIComponent(password); + const DATABASE_URL = `postgresql://${username}:${pass}@${process.env.CLUSTER_URL}/coderunner?schema=public`; const output = execSync( `DATABASE_URL="${DATABASE_URL}" ./node_modules/.bin/prisma migrate deploy`