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

Commit 9c6e58c

Browse files
authored
Merge pull request #545 from ldapjs/issue-480
Add test for issue #480
2 parents b0d2c1a + 528a78b commit 9c6e58c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/client.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const util = require('util')
4+
const assert = require('assert')
45
const tap = require('tap')
56
const uuid = require('uuid')
67
const vasync = require('vasync')
@@ -57,6 +58,12 @@ tap.beforeEach((done, t) => {
5758
return next()
5859
})
5960

61+
server.modifyDN('cn=issue-480', function (req, res, next) {
62+
assert(req.newRdn.toString().length > 132)
63+
res.end()
64+
return next()
65+
})
66+
6067
server.search('dc=slow', function (req, res, next) {
6168
res.send({
6269
dn: 'dc=slow',
@@ -533,6 +540,15 @@ tap.test('modify DN new superior', function (t) {
533540
})
534541
})
535542

543+
tap.test('modify DN excessive length (GH-480)', function (t) {
544+
t.context.client.modifyDN('cn=issue-480', 'cn=a292979f2c86d513d48bbb9786b564b3c5228146e5ba46f404724e322544a7304a2b1049168803a5485e2d57a544c6a0d860af91330acb77e5907a9e601ad1227e80e0dc50abe963b47a004f2c90f570450d0e920d15436fdc771e3bdac0487a9735473ed3a79361d1778d7e53a7fb0e5f01f97a75ef05837d1d5496fc86968ff47fcb64', function (err, res) {
545+
t.error(err)
546+
t.ok(res)
547+
t.equal(res.status, 0)
548+
t.end()
549+
})
550+
})
551+
536552
tap.test('search basic', function (t) {
537553
t.context.client.search('cn=test, ' + SUFFIX, '(objectclass=*)', function (err, res) {
538554
t.error(err)

0 commit comments

Comments
 (0)