Skip to content

Commit 7561b88

Browse files
committed
Fix ssl=false parsing
ssl was mistakenly set to the string "false" instead of the Boolean false.
1 parent 0b9bb34 commit 7561b88

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/pg-connection-string/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function parse(str) {
6161
config.ssl = true
6262
}
6363

64-
if (config.ssl === '0') {
64+
if (config.ssl === 'false' || config.ssl === '0') {
6565
config.ssl = false
6666
}
6767

packages/pg-connection-string/test/parse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ describe('parse', function () {
199199
var subject = parse(connectionString)
200200
subject.ssl.should.equal(true)
201201
})
202+
203+
it('configuration parameter ssl=false', function () {
204+
var connectionString = 'pg:///?ssl=false'
205+
var subject = parse(connectionString)
206+
subject.ssl.should.equal(false)
207+
})
202208

203209
it('configuration parameter ssl=1', function () {
204210
var connectionString = 'pg:///?ssl=1'

0 commit comments

Comments
 (0)