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