Fix · Cloudflare
Fix “CORS policy” on Cloudflare
Never echo back the request Origin. Allow only a fixed list of your own origins, and only send credentials to those.
// Transform Rules: set Access-Control-Allow-Origin to a
// fixed origin, never echo the request Origin header.
Verify the fix
Re-run the CORS policy check after deploying. Test config changes in staging first and keep a rollback: a wrong header can break a site faster than a missing one.
Other stacks: nginx · Apache · Caddy · Express / Node