mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(api): Allow x-client to be set in cors middleware (#8117)
* fix(api): Allow x-client to be set in cors middleware * chore: update cors middlware tests
This commit is contained in:
@@ -2,7 +2,7 @@ module.exports = function corsMiddleware (req, res, next) {
|
||||
res.set({
|
||||
'Access-Control-Allow-Origin': req.header('origin') || '*',
|
||||
'Access-Control-Allow-Methods': 'OPTIONS,GET,POST,PUT,HEAD,DELETE',
|
||||
'Access-Control-Allow-Headers': 'Content-Type,Accept,Content-Encoding,X-Requested-With,x-api-user,x-api-key',
|
||||
'Access-Control-Allow-Headers': 'Content-Type,Accept,Content-Encoding,X-Requested-With,x-api-user,x-api-key,x-client',
|
||||
});
|
||||
if (req.method === 'OPTIONS') return res.sendStatus(200);
|
||||
return next();
|
||||
|
||||
Reference in New Issue
Block a user