Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Non ascii characters in filter not working in client search #936

Closed
jimmyengman opened this issue Aug 15, 2023 · 1 comment
Closed

Non ascii characters in filter not working in client search #936

jimmyengman opened this issue Aug 15, 2023 · 1 comment

Comments

@jimmyengman
Copy link

If I start an OpenLDAP docker container as suggested in https://github.com/ldapjs/docker-test-openldap and then connect to it with ldap.createClient I can search with filter sn=Conrad and get a searchEntry for Hermes Conrad printed but when I search for sn=Rodríguez no entry is found.

import { default as ldap } from 'ldapjs';

// ************ if this opts are used an entry will be printed ************
// const opts = {
// filter: '(&(sn=Conrad)',
// scope: 'sub',
// attributes: ['dn', 'sn', 'cn'],
// type: 'user'
// };

// ************ using this opts no entry is found *****************
const opts = {
filter: '(&(sn=Rodríguez)',
scope: 'sub',
attributes: ['dn', 'sn', 'cn'],
type: 'user'
};

client.search('dc=planetexpress,dc=com', opts, (err, res) => {

res.on('searchRequest', (searchRequest) => {
console.log('searchRequest: ', searchRequest.messageId);
});
res.on('searchEntry', (entry) => {
console.log('entry: ' + JSON.stringify(entry.pojo));
});
res.on('searchReference', (referral) => {
console.log('referral: ' + referral.uris.join());
});
res.on('error', (err) => {
console.error('error: ' + err.message);
});
res.on('end', (result) => {
console.log('status: ' + result.status);
});
});

@jsumners
Copy link
Member

Duplicate of #860. Please review that issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants