Update: Remove Origin

This commit is contained in:
Yûki VACHOT 2021-12-29 17:30:37 +01:00
parent a330e71860
commit b26c75f163

View file

@ -5,7 +5,8 @@ const allowList = [
'http://127.0.0.1:4200',
'http://127.0.0.1:4201',
'https://admin-polynotfound.herokuapp.com',
'https://polynotfound.herokuapp.com'
'https://polynotfound.herokuapp.com',
];
const corsOptionsDelegate = function(req, callback) {
@ -13,13 +14,13 @@ const corsOptionsDelegate = function(req, callback) {
let corsOptions;
if (allowList.indexOf(req.header('Origin')) !== -1) {
corsOptions = {
origin: true,
origin: false,
credentials: true
}
} else {
corsOptions = {
origin: false,
credentials: false
credentials: true
}
}
console.log(corsOptions);