CORS Mechanism
Cross-Origin Resource Sharing (CORS) is a browser security mechanism that allows web pages to make requests to a different domain than the one serving the web page. CORS works by adding HTTP headers to responses that tell browsers which origins, methods, and headers are allowed. The browser enforces these policies, blocking requests that don't comply. CORS is essential for modern web applications that separate frontend and backend into different domains or ports.