GH-20 case insensitive treatment of attribute names in a DN
This commit is contained in:
parent
ffb06e8285
commit
12356c5628
|
@ -26,7 +26,7 @@ function RDN(obj) {
|
|||
|
||||
if (obj) {
|
||||
Object.keys(obj).forEach(function(k) {
|
||||
self[k] = obj[k];
|
||||
self[k.toLowerCase()] = obj[k];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ function parse(name) {
|
|||
trim();
|
||||
var value = parseAttrValue();
|
||||
trim();
|
||||
rdn[attr] = value;
|
||||
rdn[attr.toLowerCase()] = value;
|
||||
if (cur >= len || name[cur] !== '+')
|
||||
break;
|
||||
++cur;
|
||||
|
|
|
@ -123,3 +123,11 @@ test('empty DNs GH-16', function(t) {
|
|||
t.notOk(_dn2.childOf(''));
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
test('case insensitive attribute names GH-20', function(t) {
|
||||
var dn1 = dn.parse('CN=foo, dc=bar');
|
||||
t.ok(dn1.equals('cn=foo, dc=bar'));
|
||||
t.ok(dn1.equals(dn.parse('cn=foo, DC=bar')));
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue