From 0a9c79d08f50e2b5fde1ee6768b3a86f18daebed Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 23:17:54 +0100 Subject: [PATCH] Refuse a malformed admin DSN before postgres 4 connects to the host it misreads --- src/plugin-host/storage-provisioning.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugin-host/storage-provisioning.ts b/src/plugin-host/storage-provisioning.ts index 4c89b52..d13ea78 100644 --- a/src/plugin-host/storage-provisioning.ts +++ b/src/plugin-host/storage-provisioning.ts @@ -20,6 +20,7 @@ export interface ProvisionResult { // so it is swallowed here. The driver, not `new URL`, decides what parses: it takes a multi-host DSN. function connect(adminUrl: string): ReturnType { try { + new URL(adminUrl); // postgres 4 connects to whatever a malformed DSN parses to, and its error names that host return postgres(adminUrl, { connect_timeout: 10, max: 1 }); } catch { throw new Error("PLUGIN_DB_ADMIN_URL must be a Postgres URL (its value is not shown; percent-encode special characters in a password)");