fix(esmole): truncate all tool responses; guard normalizes leading slash
This commit is contained in:
1 parent
ab5416f443
commit
dd6ca2deff
10 files changed
+94
-16
No files matched your search
@@ -45,6 +45,11 @@ describe('assertReadAllowed', () => {
|
||||
it('ignores a trailing slash', () => {
|
||||
expect(() => assertReadAllowed('POST', '/idx/_search/')).not.toThrow()
|
||||
})
|
||||
it('treats a missing leading slash like the slashed path', () => {
|
||||
expect(() => assertReadAllowed('POST', '_search')).not.toThrow()
|
||||
expect(() => assertReadAllowed('POST', 'idx/_search')).not.toThrow()
|
||||
expect(() => assertReadAllowed('POST', 'idx/_doc')).toThrow(EsGuardError)
|
||||
})
|
||||
it('rejects an unknown method', () => {
|
||||
expect(() => assertReadAllowed('PATCH', '/idx/_search')).toThrow(EsGuardError)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user