mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-06 06:01:31 -05:00
fix(api): allow coderoad and exam env headers (#56619)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user