Skip to content

Commit

Permalink
Merge pull request #2787 from aws-amplify/fix-sql-pg-canary
Browse files Browse the repository at this point in the history
fix: encode password to handle special chars
  • Loading branch information
phani-srikar authored Aug 19, 2024
2 parents 8448067 + e96acfa commit da7f44b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,6 @@ export class SqlDatatabaseController {
*/
getConnectionUri = (engine: SqlEngine, username: string, password: string, hostname: string, port: number, dbName: string): string => {
const protocol = engine === 'postgres' ? 'postgresql' : 'mysql';
return `${protocol}://${username}:${password}@${hostname}:${port}/${dbName}`;
return `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${hostname}:${port}/${dbName}`;
};
}

0 comments on commit da7f44b

Please sign in to comment.