GWM : helmet

This commit is contained in:
Gowtham M 2025-12-04 14:52:12 +05:30
parent 0c8de40ae5
commit 06ec81bae9

View File

@ -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",