Delete method is not working in my frontend-backend app running on different ports

I have tried fixing it with cors but it just doesn’t work . I have also used the full url of backend and frontend that is exposed publicly . The exact error that I am getting is by cors saying the preflight was redirected and that is not allowed . I am guessing the idx is intercepting the request and that is causing the problem . I don’t know how to fix this. please help me here , I face these problems regularly working on this platform .

thankyou .

the configuration and code →

cors →

app.use(cors({
   origin:["http://localhost:5173",FRONTEND_URL],
   methods:["GET","POST","DELETE","PUT","OPTIONS"],
   credentials:true,
   allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'device-remember-token', 'Access-Control-Allow-Origin', 'Origin', 'Accept']
}));

the FRONTEND_URL contains full public exposed url with https://5173…dev/

I would be really grateful if you could provide me a solution here :slightly_smiling_face:

the request was intercepted by this url →
https://idx-webdevelopment-1744699567404.cluster-xpmcxs2fjnhg6xvn446ubtgpio.cloudworkstations.dev/_workstation/forwardAuthCookie?_workstationRedirectOrigin=https%3A%2F%2F5173-idx-webdevelopment-1744699567404.cluster-xpmcxs2fjnhg6xvn446ubtgpio.cloudworkstations.dev&redirectToken=xM7OoCYTerCrYT_VkuI9yQ

and I don’t know how to stop this . Also one more weird thing - post and get methods are working just fine .