Cross-origin policy
The same-origin policy is a browser security restriction that limits scripts and documents from accessing resources associated with different origins unless explicitly permitted.
Building Web APIs with ASP.NET Core
The same-origin policy is a browser security rule that restricts scripts from accessing resources unless their protocol, host, and port origins match.
- How it is used
- Explains why a browser-based app needs CORS to request an API hosted on another domain.
- How deep it goes
- Defines origin matching and shows CORS policy configuration without detailing browser enforcement internals.
- Examples
- Uses an Angular app requesting a board-game API on another domain and ASP.NET Core CORS policy listings.
- What you can do after
- Operate/configure it in ASP.NET Core by registering a CORS policy and enabling it through middleware or endpoints.
Read how Building Web APIs with ASP.NET Core explains cross-origin policy →
ASP.NET Core in Action, 3e
The same-origin policy is a browser security restriction that limits scripts' access to resources from a different origin unless that access is explicitly permitted.
- How it is used
- Protects web APIs by restricting JavaScript requests from applications with different origins.
- How deep it goes
- Defines origin matching and demonstrates blocked URLs, then defers permission configuration to CORS.
- Examples
- Uses matching and mismatching example.com URLs plus a shopping site calling a separate product API.
- What you can do after
- Evaluate whether a JavaScript request is same-origin and recognize when CORS permission is required.
Read how ASP.NET Core in Action, 3e explains cross-origin policy →
Related concepts
- CORSaddressed by · Cross-Origin Resource Sharing (CORS) is a web standard that uses HTTP headers to let servers specify which origins may access their resources through browsers.
- originconfigures · A web origin is the security identity defined by a resource's scheme, host, and port.
- JavaScriptconfigures · JavaScript is a high-level, dynamically typed, multi-paradigm programming language standardized as ECMAScript and used for web and general-purpose programming.
- browserused by · A web browser is software that retrieves, interprets, and renders web resources, executes supported web content, and enables interaction with web pages and applications.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

