Skip to content

Commit

Permalink
fix: encode password to handle special chars
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed Aug 19, 2024
1 parent 826ffe8 commit baa9bf3
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}://${username}:${encodeURIComponent(password)}@${hostname}:${port}/${dbName}`;
};
}

0 comments on commit baa9bf3

Please sign in to comment.