Update preflight header

This commit is contained in:
Moe Poi ~ 2022-05-13 11:55:45 +07:00
parent ee3822bc2d
commit 20ac25478d

View file

@ -31,10 +31,11 @@ app.use('/api', api);
app.use(function (req, res, next) { app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Origin", "*");
res.header( res.header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, HEAD");
"Access-Control-Allow-Headers", res.header("Access-Control-Allow-Headers", "custId, appId, Origin, Content-Type, Cookie, X-CSRF-TOKEN, Accept, Authorization, X-XSRF-TOKEN, Access-Control-Allow-Origin, X-Requested-With");
"Origin, X-Requested-With, Content-Type, Accept" res.header("Access-Control-Expose-Headers", "Authorization, authenticated");
); res.header("Access-Control-Max-Age", "1728000");
res.header("Access-Control-Allow-Credentials", "true");
next(); next();
}); });