Fixes serverless common API security response headers API tests (#162655)

Unblocks #162149

## Summary
Fixes serverless security response headers tests by using the internal
request header. This PR also opts to use the `/logout` redirect endpoint
in testing, as it is more relevant to serverless.
This commit is contained in:
Jeramy Soucy 2023-07-27 14:25:26 -04:00 committed by GitHub
parent b867d42f84
commit 614044bff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ export default function ({ getService }: FtrProviderContext) {
it('API endpoint response contains default security headers', async () => {
const { header } = await supertest
.get(`/internal/security/me`)
.set(svlCommonApi.getCommonRequestHeader())
.set(svlCommonApi.getInternalRequestHeader())
.expect(200);
expect(header).toBeDefined();
@ -40,9 +40,9 @@ export default function ({ getService }: FtrProviderContext) {
it('redirect endpoint response contains default security headers', async () => {
const { header } = await supertest
.get(`/login`)
.get(`/logout`)
.set(svlCommonApi.getCommonRequestHeader())
.expect(302);
.expect(200);
expect(header).toBeDefined();
expect(header['content-security-policy']).toEqual(defaultCSP);