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);
|
attr.vals.push(v);
|
||||||
});
|
});
|
||||||
} else if (typeof(obj[k]) === 'string') {
|
|
||||||
attr.vals.push(obj[k]);
|
|
||||||
} else {
|
} else {
|
||||||
throw new TypeError(k + ' -> ' + obj[k] + ' is not a string');
|
attr.vals.push(obj[k] + '');
|
||||||
}
|
}
|
||||||
|
|
||||||
self.attributes.push(attr);
|
self.attributes.push(attr);
|
||||||
|
|
|
@ -53,8 +53,6 @@ SearchResponse.prototype.send = function(entry, nofiltering) {
|
||||||
if (entry.messageID !== this.messageID)
|
if (entry.messageID !== this.messageID)
|
||||||
throw new Error('SearchEntry messageID mismatch');
|
throw new Error('SearchEntry messageID mismatch');
|
||||||
} else {
|
} else {
|
||||||
if (!entry.dn)
|
|
||||||
throw new Error('entry.dn required');
|
|
||||||
if (!entry.attributes)
|
if (!entry.attributes)
|
||||||
throw new Error('entry.attributes required');
|
throw new Error('entry.attributes required');
|
||||||
|
|
||||||
|
|
|
@ -782,10 +782,10 @@ Server.prototype._getHandlerChain = function(req) {
|
||||||
|
|
||||||
Server.prototype._mount = function(op, name, argv, notDN) {
|
Server.prototype._mount = function(op, name, argv, notDN) {
|
||||||
assert.ok(op);
|
assert.ok(op);
|
||||||
assert.ok(name);
|
assert.ok(name !== undefined);
|
||||||
assert.ok(argv);
|
assert.ok(argv);
|
||||||
|
|
||||||
if (!name || typeof(name) !== 'string')
|
if (typeof(name) !== 'string')
|
||||||
throw new TypeError('name (string) required');
|
throw new TypeError('name (string) required');
|
||||||
if (argv.length < 1)
|
if (argv.length < 1)
|
||||||
throw new Error('at least one handler required');
|
throw new Error('at least one handler required');
|
||||||
|
|
Loading…
Reference in New Issue