GWM : helmet
This commit is contained in:
parent
0c8de40ae5
commit
06ec81bae9
11
server.js
11
server.js
@ -26,16 +26,19 @@ app.use(sanitizeInput);
|
||||
|
||||
// app.use(cors());
|
||||
const allowedOrigins = [
|
||||
"http://localhost:5173/", //local
|
||||
"http://13.201.47.205:5173/", //dev
|
||||
"http://13.201.47.205:5175/" //uat
|
||||
"http://localhost:5173", //local
|
||||
"http://13.201.47.205:5173", //dev
|
||||
"http://13.201.47.205:5175", //uat
|
||||
"https://ipi.venbait.in/api"
|
||||
];
|
||||
app.use(cors({
|
||||
origin: allowedOrigins,
|
||||
credentials: true
|
||||
}));
|
||||
app.use((req, res, next) => {
|
||||
res.header("Access-Control-Allow-Origin", req.headers.origin);
|
||||
if (allowedOrigins.includes(req.headers.origin)) {
|
||||
res.header("Access-Control-Allow-Origin", req.headers.origin);
|
||||
}
|
||||
res.header("Access-Control-Allow-Credentials", "true");
|
||||
res.header(
|
||||
"Access-Control-Allow-Headers",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user