Allow empty dns in search (e.g., enable rootDSE searches)
This commit is contained in:
parent
b07bc382bc
commit
1105b47293
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue