Skip to content

Commit 58a47d8

Browse files
committed
Updated allowed origins
1 parent f8f2554 commit 58a47d8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

backend/src/server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ const limiter = rateLimit({
3737
app.use(helmet());
3838
app.use(cors({
3939
origin: (origin, callback) => {
40+
// Log the origin for debugging
41+
console.log('Incoming origin:', origin);
42+
4043
const allowedOrigins = [
4144
process.env.FRONTEND_URL,
4245
'https://occasio.ayushh.in',
4346
'https://www.occasio.ayushh.in'
4447
].filter(Boolean);
48+
4549
// Allow requests with no origin (like mobile apps or curl requests)
4650
if (!origin) return callback(null, true);
4751

@@ -54,6 +58,11 @@ app.use(cors({
5458
return callback(null, true);
5559
}
5660

61+
// Explicitly allow the domain if it matches (incase of string mismatches)
62+
if (origin.includes('occasio.ayushh.in')) {
63+
return callback(null, true);
64+
}
65+
5766
// For now, in development we might want to be permissive if it's not matching above
5867
if (process.env.NODE_ENV !== 'production') {
5968
return callback(null, true);

0 commit comments

Comments
 (0)