Skip to content

Commit 7ad6ba4

Browse files
committed
Fix ssl=false parsing
ssl was mistakenly set to the string "false" instead of the Boolean false.
1 parent 5233b3e commit 7ad6ba4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function parse(str) {
5858
config.ssl = true;
5959
}
6060

61-
if (config.ssl === '0') {
61+
if (config.ssl === 'false' || config.ssl === '0') {
6262
config.ssl = false;
6363
}
6464

test/parse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ describe('parse', function(){
180180
var subject = parse(connectionString);
181181
subject.ssl.should.equal(true);
182182
});
183+
184+
it('configuration parameter ssl=false', function(){
185+
var connectionString = 'pg:///?ssl=false';
186+
var subject = parse(connectionString);
187+
subject.ssl.should.equal(false);
188+
});
183189

184190
it('configuration parameter ssl=1', function(){
185191
var connectionString = 'pg:///?ssl=1';

0 commit comments

Comments
 (0)