fix: reject non-object browse cursors

This commit is contained in:
Jonathan Finley 2026-03-13 21:24:03 -04:00
parent f24bd19cb7
commit 6b7550c25b
2 changed files with 10 additions and 0 deletions

View file

@ -59,4 +59,10 @@ describe('libraryBrowseCursor', () => {
expect(() => decodeBrowseCursor(malformedJsonCursor)).to.throw('Invalid browse cursor')
})
it('rejects decoded non-object json payloads with a controlled invalid-cursor error', () => {
const nonObjectCursor = Buffer.from('null', 'utf8').toString('base64url')
expect(() => decodeBrowseCursor(nonObjectCursor)).to.throw('Invalid browse cursor')
})
})