diff --git a/lib/filters/equality_filter.js b/lib/filters/equality_filter.js index 87b7931..9638507 100644 --- a/lib/filters/equality_filter.js +++ b/lib/filters/equality_filter.js @@ -49,10 +49,16 @@ EqualityFilter.prototype.matches = function (target) { if (typeof (target) !== 'object') throw new TypeError('target (object) required'); + var self = this; + if (target.hasOwnProperty(this.attribute)) { var value = this.value; return Filter.multi_test( - function (v) { return value === v; }, + function (v) { + if (self.attribute === 'objectclass') + v = v.toLowerCase(); + return value === v; + }, target[this.attribute]); } diff --git a/lib/filters/substr_filter.js b/lib/filters/substr_filter.js index e3672d6..417a2cc 100644 --- a/lib/filters/substr_filter.js +++ b/lib/filters/substr_filter.js @@ -89,8 +89,13 @@ SubstringFilter.prototype.matches = function (target) { re += this['final'] + '$'; var matcher = new RegExp(re); + var self = this; return Filter.multi_test( - function (v) { return matcher.test(v); }, + function (v) { + if (self.attribute === 'objectclass') + v = v.toLowerCase(); + return matcher.test(v); + }, target[this.attribute]); }