Skip to content

Commit

Permalink
fix: encode the username as well since mysql supports spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed Aug 19, 2024
1 parent baa9bf3 commit e96acfa
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}:${encodeURIComponent(password)}@${hostname}:${port}/${dbName}`;
return `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${hostname}:${port}/${dbName}`;
};
}

0 comments on commit e96acfa

Please sign in to comment.