From 20ac25478d9663fb4f9e202b85750397beb36e9c Mon Sep 17 00:00:00 2001 From: Moe Date: Fri, 13 May 2022 11:55:45 +0700 Subject: [PATCH] Update preflight header --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5ecdf89..13d3477 100644 --- a/index.js +++ b/index.js @@ -31,10 +31,11 @@ app.use('/api', api); app.use(function (req, res, next) { res.header("Access-Control-Allow-Origin", "*"); - res.header( - "Access-Control-Allow-Headers", - "Origin, X-Requested-With, Content-Type, Accept" - ); + res.header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, HEAD"); + 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"); + res.header("Access-Control-Expose-Headers", "Authorization, authenticated"); + res.header("Access-Control-Max-Age", "1728000"); + res.header("Access-Control-Allow-Credentials", "true"); next(); });