xuất excel
This commit is contained in:
@@ -121,6 +121,19 @@ test('forged legacy identity headers cannot bypass protected APIs', async () =>
|
||||
});
|
||||
});
|
||||
|
||||
test('saved export files, preview and batch exports require an authenticated session', async () => {
|
||||
await withTestServer(async baseUrl => {
|
||||
for (const [route, method] of [
|
||||
['/api/asset-export-documents/f13b142b-913b-44b8-b15c-d719bd45d197', 'GET'],
|
||||
['/api/asset-export-documents/f13b142b-913b-44b8-b15c-d719bd45d197/download', 'GET'],
|
||||
['/api/assets/export', 'POST']
|
||||
]) {
|
||||
const response = await fetch(baseUrl + route, { method, headers: { 'x-user-role': 'admin' } });
|
||||
assert.equal(response.status, 401);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('security headers and no-store API caching are enabled', async () => {
|
||||
await withTestServer(async baseUrl => {
|
||||
const response = await fetch(`${baseUrl}/api/health`);
|
||||
|
||||
Reference in New Issue
Block a user