File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ const limiter = rateLimit({
3737app . use ( helmet ( ) ) ;
3838app . 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 ) ;
You can’t perform that action at this time.
0 commit comments