Update: Remove Origin
This commit is contained in:
parent
a330e71860
commit
b26c75f163
1 changed files with 4 additions and 3 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Reference in a new issue