CORS
The browser rule set that decides whether web page code from one origin may read a response from a different origin.
In more detail
CORS stands for Cross-Origin Resource Sharing. The server grants permission with Access-Control headers, and the browser enforces it by hiding the answer from the page when permission is missing. It controls browser visibility only: it is not authentication or authorization, and tools like curl ignore it entirely.
Examples
In the browser: CORS stands for Cross-Origin Resource Sharing. The server replies with headers such as Access-Control-Allow-Origin; the browser enforces them by hiding the response from scripts when they are missing. CORS relaxes the same-origin policy; it is not a server-side protection, because non-browser clients ignore it.The course's safe default is an empty list of allowed origins, so no other site is trusted until someone names it.Related terms
- origin — The scheme, host and port a web page came from, such as https://app.example, which browsers use to decide what the page may access.
- same-origin policy — The browser security rule that stops page code from reading responses from a different origin unless that origin allows it.
- preflight request — An automatic OPTIONS request a browser sends before a cross-origin request that is not simple, to ask the server for permission first.
- CORS headers — The Access-Control response headers a server uses to tell browsers which origins, methods and headers may be used across origins, and for how long.
- authentication — Establishing who a request represents, for example by checking a password, a session cookie or a signed token.
- Access-Control-Allow-Origin — The CORS response header naming which origin may read the response, either one exact origin or * for any.
- Access-Control-Allow-Credentials — The CORS response header that must be true for the browser to expose a response to a request sent with cookies or other credentials.
- secure by default — Designing software so the setting you get by typing nothing is the safe one, and anything riskier must be asked for by name.
Taught in
- Cookies And CORS — Modern API Architecture: REST, GraphQL & gRPC
- Security Best Practices — Modern API Architecture: REST, GraphQL & gRPC
- Same-Origin Policy, CORS Preflight, Credentials And Headers — Frontend Architecture & Web Platform
- Secure Defaults — Application Security & Threat Modeling for Engineers