pg-connection-string
Advanced tools
Comparing version
15
index.js
@@ -26,7 +26,12 @@ 'use strict' | ||
try { | ||
result = new URL(str, 'postgres://base') | ||
} catch (e) { | ||
// The URL is invalid so try again with a dummy host | ||
result = new URL(str.replace('@/', '@___DUMMY___/'), 'postgres://base') | ||
dummyHost = true | ||
try { | ||
result = new URL(str, 'postgres://base') | ||
} catch (e) { | ||
// The URL is invalid so try again with a dummy host | ||
result = new URL(str.replace('@/', '@___DUMMY___/'), 'postgres://base') | ||
dummyHost = true | ||
} | ||
} catch (err) { | ||
// Remove the input from the error message to avoid leaking sensitive information | ||
err.input && (err.input = '*****REDACTED*****') | ||
} | ||
@@ -33,0 +38,0 @@ |
{ | ||
"name": "pg-connection-string", | ||
"version": "2.9.0", | ||
"version": "2.9.1", | ||
"description": "Functions for dealing with a PostgresSQL connection string", | ||
@@ -51,3 +51,3 @@ "main": "./index.js", | ||
], | ||
"gitHead": "abff18d6f918c975e8b3dfebc0de3b811ae64bcb" | ||
"gitHead": "cd877a57612a39335a97b593111710d26126279d" | ||
} |
@@ -88,7 +88,7 @@ pg-connection-string | ||
* `uselibpqcompat=true` - use libpq semantics | ||
* `sslmode=<sslmode>` when `sslcompat` is not set | ||
* `sslmode=<sslmode>` when `uselibpqcompat=true` is not set | ||
* `sslmode=disable` - sets `ssl` to false | ||
* `sslmode=no-verify` - sets `ssl` to `{ rejectUnauthorized: false }` | ||
* `sslmode=prefer`, `sslmode=require`, `sslmode=verify-ca`, `sslmode=verify-full` - sets `ssl` to true | ||
* `sslmode=<sslmode>` when `sslcompat=libpq` | ||
* `sslmode=<sslmode>` when `uselibpqcompat=true` | ||
* `sslmode=disable` - sets `ssl` to false | ||
@@ -95,0 +95,0 @@ * `sslmode=prefer` - sets `ssl` to `{ rejectUnauthorized: false }` |
14902
1.33%219
2.34%