chore(): remove ssl_mode from url and also use sslmode (#13568)
* chore(): remove ssl_mode from url and also use sslmode * improve regexp * chore(): remove ssl_mode from url and also use sslmode * chore(): remove ssl_mode from url and also use sslmode * Update SSL mode configuration in changeset Removed 'ssl_mode' from URL and replaced it with 'sslmode'.
This commit is contained in:
committed by
GitHub
parent
730d73306d
commit
92d30b28f4
@@ -38,8 +38,18 @@ export async function pgConnectionLoader(): Promise<
|
||||
|
||||
delete driverOptions.pool
|
||||
|
||||
const clientUrl = connectionString?.replace(
|
||||
/(\?|&)ssl_mode=[^&]*(&|$)/gi,
|
||||
(match, prefix, suffix) => {
|
||||
if (prefix === "?" && suffix === "&") return "?"
|
||||
if (prefix === "?" && suffix === "") return ""
|
||||
if (prefix === "&") return suffix
|
||||
return ""
|
||||
}
|
||||
)
|
||||
|
||||
const pgConnection = ModulesSdkUtils.createPgConnection({
|
||||
clientUrl: connectionString,
|
||||
clientUrl,
|
||||
schema,
|
||||
driverOptions,
|
||||
pool: {
|
||||
|
||||
Reference in New Issue
Block a user