Merge pull request #6 from instanceof/master

Default ports for ldap and ldaps
This commit is contained in:
Mark Cavage 2011-08-26 15:38:19 -07:00
commit ae0aeee761
1 changed files with 6 additions and 6 deletions

View File

@ -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));