Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/pg-connection-string/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function parse(str, options = {}) {
} catch (err) {
// Remove the input from the error message to avoid leaking sensitive information
err.input && (err.input = '*****REDACTED*****')
throw err
}

// We'd like to use Object.fromEntries() here but Node.js 10 does not support it
Expand Down
1 change: 1 addition & 0 deletions packages/pg-connection-string/test/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ describe('parse', function () {
parse(connectionString)
} catch (err: unknown) {
expect(JSON.stringify(err)).to.not.include(password, 'Password should not be in the error message')
expect(JSON.stringify(err)).to.include('REDACTED', 'The thrown error should contain the redacted URL')
return
}
throw new Error('Expected an error to be thrown')
Expand Down