mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Merge pull request #28 from hjr3/ssl-parsing
ssl=0 is now parses to false
This commit is contained in:
commit
d7b96e6f44
4
index.js
4
index.js
@ -49,6 +49,10 @@ function parse(str) {
|
||||
config.ssl = true;
|
||||
}
|
||||
|
||||
if (config.ssl === '0') {
|
||||
config.ssl = false;
|
||||
}
|
||||
|
||||
if (config.sslcert || config.sslkey || config.sslrootcert) {
|
||||
config.ssl = {};
|
||||
}
|
||||
|
||||
@ -150,6 +150,12 @@ describe('parse', function(){
|
||||
subject.ssl.should.equal(true);
|
||||
});
|
||||
|
||||
it('configuration parameter ssl=0', function(){
|
||||
var connectionString = 'pg:///?ssl=0';
|
||||
var subject = parse(connectionString);
|
||||
subject.ssl.should.equal(false);
|
||||
});
|
||||
|
||||
it('set ssl', function () {
|
||||
var subject = parse('pg://myhost/db?ssl=1');
|
||||
subject.ssl.should.equal(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user