Merge pull request #6 from instanceof/master
Default ports for ldap and ldaps
This commit is contained in:
commit
ae0aeee761
12
lib/url.js
12
lib/url.js
|
@ -15,16 +15,16 @@ module.exports = {
|
|||
if (!u.protocol || !(u.protocol === 'ldap:' || u.protocol === 'ldaps:'))
|
||||
throw new TypeError(urlStr + ' is an invalid LDAP url (protocol)');
|
||||
|
||||
if (!u.port) {
|
||||
u.port = 389;
|
||||
} else {
|
||||
u.port = parseInt(u.port, 10);
|
||||
}
|
||||
u.secure = (u.protocol === 'ldaps:');
|
||||
|
||||
if (!u.hostname)
|
||||
u.hostname = 'localhost';
|
||||
|
||||
u.secure = (u.protocol === 'ldaps:');
|
||||
if (!u.port) {
|
||||
u.port = (u.secure ? 636 : 389);
|
||||
} else {
|
||||
u.port = parseInt(u.port, 10);
|
||||
}
|
||||
|
||||
if (u.pathname) {
|
||||
u.pathname = querystring.unescape(u.pathname.substr(1));
|
||||
|
|
Loading…
Reference in New Issue