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

Commit

Permalink
Allow for AD range attribute option
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Tabor committed Nov 7, 2023
1 parent cdd90b4 commit 0faadb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/messages/search-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const isValidAttributeString = str => {
return true
}
// ascii attribute names
if (/^[a-zA-Z][\w\d.;-]*$/.test(str) === true) {
if (/^[a-zA-Z][\w\d.;=*-]*$/.test(str) === true) {
return true
}
return false
Expand Down
7 changes: 7 additions & 0 deletions lib/messages/search-request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ tap.test('.attributes', t => {
t.strictSame(req.attributes, ['a'])
})

t.test('supports range options', async t => {
const req = new SearchRequest({
attributes: ['a;range=0-*']
})
t.strictSame(req.attributes, ['a;range=0-*'])
})

t.test('skip empty attribute name', async t => {
process.on('warning', handler)
t.teardown(async () => {
Expand Down

0 comments on commit 0faadb6

Please sign in to comment.