Skip to content

Commit 7b62226

Browse files
committed
ssl=0 is now parses to false
Fixes #20
1 parent 43114f4 commit 7b62226

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ function parse(str) {
4949
config.ssl = true;
5050
}
5151

52+
if (config.ssl === '0') {
53+
config.ssl = false;
54+
}
55+
5256
if (config.sslcert || config.sslkey || config.sslrootcert) {
5357
config.ssl = {};
5458
}

test/parse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ describe('parse', function(){
150150
subject.ssl.should.equal(true);
151151
});
152152

153+
it('configuration parameter ssl=0', function(){
154+
var connectionString = 'pg:///?ssl=0';
155+
var subject = parse(connectionString);
156+
subject.ssl.should.equal(false);
157+
});
158+
153159
it('set ssl', function () {
154160
var subject = parse('pg://myhost/db?ssl=1');
155161
subject.ssl.should.equal(true);

0 commit comments

Comments
 (0)