Loading Depth Study
Preparing your workspace
CORS is a browser security mechanism that controls whether a web page can access resources from another origin.
An origin is defined by scheme, host, and port. Browsers enforce a same-origin security model that restricts many cross-origin reads. CORS allows a server to explicitly tell the browser which cross-origin requests are permitted. Some requests require a preflight OPTIONS request before the browser sends the actual request. CORS is a browser behavior; it is not a replacement for authentication or server-side authorization.
A frontend hosted at one domain may call an API hosted at another domain, but the API must configure the appropriate CORS policy.
Access-Control-Allow-Origin: https://app.example.com Access-Control-Allow-Methods: GET, POST, PATCH Access-Control-Allow-Headers: Content-Type, Authorization
The server explicitly allows a trusted frontend origin and selected HTTP methods and headers.