CORS error in preview env only

Weird issue here - my preview and prod express apps both have the same code deployed, and I have a corresponding preview and prod frontend fetching from them. CORS is configured by strictly allowing traffic from the corresponding frontend domain, and I’ve console logged to verify that it’s the right origin. Prod deployment handles CORS fine, but preview doesn’t. What gives? Is it because I’m using the domain dedicated to the most recent preview?

If you’re having trouble deploying an Express app, this guide can help.

You can also ask v0 for suggestions tailored to your own project setup.

Hi, solis!

We recently shipped this community post that may be helpful to you:

Let us know how you get on!

This is not helpful. I mentioned in the post that I have a working deployment in prod. The title also mentioned the CORS config only fails in preview. This is not an issue of needing to understand cross origin resource sharing, this is an issue of cross origin resource sharing not respecting the origin that is logged on request