Browse Source

fix: encode url params

pull/7653/head
Pranav C 9 months ago
parent
commit
83287ef150
  1. 10
      packages/nocodb/src/utils/nc-config/helpers.ts

10
packages/nocodb/src/utils/nc-config/helpers.ts

@ -109,14 +109,16 @@ export function jdbcToXcUrl(url: string): string {
const extraParams = []; const extraParams = [];
for (const [key, value] of Object.entries(extra)) { for (const [key, value] of Object.entries(extra)) {
extraParams.push(`${key}=${value}`); extraParams.push(`${key}=${encodeURIComponent(value + '')}`);
} }
const res = `${driverClientMapping[driver] || driver}://${host}${ const res = `${driverClientMapping[driver] || driver}://${host}${
port ? `:${port}` : '' port ? `:${port}` : ''
}?${user ? `u=${user}&` : ''}${password ? `p=${password}&` : ''}${ }?${user ? `u=${encodeURIComponent(user)}&` : ''}${
database ? `d=${database}&` : '' password ? `p=${encodeURIComponent(password)}&` : ''
}${extraParams.join('&')}`; }${database ? `d=${encodeURIComponent(database)}&` : ''}${extraParams.join(
'&',
)}`;
return res; return res;
} }

Loading…
Cancel
Save