Allow empty dns in search (e.g., enable rootDSE searches)

This commit is contained in:
Mark Cavage 2011-09-29 09:35:53 -07:00
parent b07bc382bc
commit 1105b47293
3 changed files with 3 additions and 7 deletions

View File

@ -88,10 +88,8 @@ SearchEntry.prototype.fromObject = function(obj) {
attr.vals.push(v);
});
} else if (typeof(obj[k]) === 'string') {
attr.vals.push(obj[k]);
} else {
throw new TypeError(k + ' -> ' + obj[k] + ' is not a string');
attr.vals.push(obj[k] + '');
}
self.attributes.push(attr);

View File

@ -53,8 +53,6 @@ SearchResponse.prototype.send = function(entry, nofiltering) {
if (entry.messageID !== this.messageID)
throw new Error('SearchEntry messageID mismatch');
} else {
if (!entry.dn)
throw new Error('entry.dn required');
if (!entry.attributes)
throw new Error('entry.attributes required');

View File

@ -782,10 +782,10 @@ Server.prototype._getHandlerChain = function(req) {
Server.prototype._mount = function(op, name, argv, notDN) {
assert.ok(op);
assert.ok(name);
assert.ok(name !== undefined);
assert.ok(argv);
if (!name || typeof(name) !== 'string')
if (typeof(name) !== 'string')
throw new TypeError('name (string) required');
if (argv.length < 1)
throw new Error('at least one handler required');