CORS Basics (and Why It’s Not “A Backend Bug”)
On this page
Understanding CORS
CORS is enforced by browsers, not servers. Servers must explicitly allow origins via headers.
res.setHeader('Access-Control-Allow-Origin', 'https://example.com');
Production Risk
Using wildcard origins on authenticated endpoints exposes credentials. Always restrict origins intentionally.