fix(api): allow coderoad and exam env headers (#56619)

This commit is contained in:
Shaun Hamilton
2024-10-09 19:06:53 +02:00
committed by GitHub
parent a7296c7983
commit 916e22fd6b
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ const cors: FastifyPluginCallback = (fastify, _options, done) => {
void reply
.header(
'Access-Control-Allow-Headers',
'Origin, X-Requested-With, Content-Type, Accept, Csrf-Token'
'Origin, X-Requested-With, Content-Type, Accept, Csrf-Token, Coderoad-User-Token, Exam-Environment-Authorization-Token'
)
.header('Access-Control-Allow-Credentials', true)
// These 4 are the only methods we use

View File

@@ -62,7 +62,7 @@ describe('server', () => {
const res = await superRequest('/', { method: 'GET' });
expect(res.headers).toMatchObject({
'access-control-allow-headers':
'Origin, X-Requested-With, Content-Type, Accept, Csrf-Token',
'Origin, X-Requested-With, Content-Type, Accept, Csrf-Token, Coderoad-User-Token, Exam-Environment-Authorization-Token',
'access-control-allow-credentials': 'true',
'access-control-allow-methods': 'GET, PUT, POST, DELETE'
});