CORS
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.
ASP.NET Core in Action, 3e
Cross-origin resource sharing is a browser and server mechanism that controls whether a web application may make requests across origins and which parts of those requests and responses are permitted.
- How it is used
- Enables browser JavaScript at one origin to access an API at another origin when the API permits it.
- How deep it goes
- Explains origins, response headers, preflight requests, and ASP.NET Core policy setup while leaving specification details to the framework.
- Examples
- Uses a shopping website calling a separate product API, failed browser requests, and ASP.NET Core policy and endpoint listings.
- What you can do after
- Apply it via ASP.NET Core AddCors(), UseCors(), and RequireCors() to permit selected cross-origin API access.
Building Web APIs with ASP.NET Core
Cross-Origin Resource Sharing (CORS) is a browser security mechanism that controls whether web clients may request resources from a different origin.
- How it is used
- Enables browser scripts at another origin to request API resources under server-defined rules.
- How deep it goes
- Defines the browser restriction and walks through ASP.NET Core policies, middleware, and endpoint assignment without examining browser internals.
- Examples
- Uses default and named policy listings, endpoint configuration, and a GET-only Minimal API exercise.
- What you can do after
- Operate/configure it in ASP.NET Core by registering policies, enabling middleware, and assigning endpoint-specific rules.
Read how Building Web APIs with ASP.NET Core explains CORS →
Spring Security in Action, Second Edition
Cross-origin resource sharing is a browser security mechanism that controls whether a web page may access resources from another origin.
- How it is used
- Explains how browser-based frontends access backend resources hosted on different origins.
- How deep it goes
- Covers browser rejection, HTTP headers, preflight requests, and endpoint or centralized Spring configuration.
- Examples
- Uses example.com, example.org, localhost:8080, an iframe, XMLHttpRequest, and a /test endpoint returning HELLO.
- What you can do after
- Configure endpoint-specific or centralized CORS rules and test browser acceptance of cross-origin responses.
Read how Spring Security in Action, Second Edition explains CORS →
Build Financial Software with Generative AI (From Scratch)
Cross-Origin Resource Sharing (CORS) is a browser security mechanism that controls whether a web page may request resources from a different origin.
- How it is used
- Controls browser-page access to a separately hosted API during local development and dashboard deployment.
- How deep it goes
- Explains preflight-related errors and response permissions, then configures FastAPI middleware; stops short of a full preflight protocol walkthrough.
- Examples
- Uses a localhost:3000 page calling a localhost:8000 health endpoint and a later localhost:4000 dashboard configuration.
- What you can do after
- Apply it via FastAPI CORSMiddleware to permit expected origins and methods, then diagnose browser CORS errors without allowing everything.
Read how Build Financial Software with Generative AI (From Scratch) explains CORS →
Spring in Action, Sixth Edition
CORS is a web security mechanism that allows a server to declare which origins may access its resources from browser-based clients.
- How it is used
- Enables a separate JavaScript client to consume a Spring REST API from an approved host or port.
- How deep it goes
- Explains the browser restriction and demonstrates annotation-based origin configuration, but does not detail CORS protocol exchanges.
- Examples
- Demonstrates @CrossOrigin on TacoController with one or multiple allowed origins.
- What you can do after
- Apply CORS via Spring's @CrossOrigin annotation to permit named browser client origins.
Rust Web Development
Cross-Origin Resource Sharing (CORS) is a browser security mechanism that controls whether web pages may access resources from a different origin.
- How it is used
- Enables browser clients on other domains to access an API by returning allowed origins, methods, and headers.
- How deep it goes
- Explains preflight requests, exceptions, Warp configuration, and rejection handling without serving as an exhaustive reference.
- Examples
- Tests a localhost /questions OPTIONS request with PUT, content-type, and Origin headers, including allowed and rejected responses.
- What you can do after
- Apply CORS via Warp by configuring allowed origins, methods, and headers; diagnose rejected headers with curl and return a 403 error.
Related concepts
- @crossoriginconfigured by · @CrossOrigin is a Spring annotation that enables and configures cross-origin resource sharing for a controller or request handler.
- cross-origin policyaddresses · The same-origin policy is a browser security restriction that limits how a document or script can interact with resources from a different origin.
- cross-origin requestconfigures · A cross-origin request is a network request from a webpage or script to a resource whose origin differs from the requester’s origin.
- HTTP headeruses · An HTTP header is a named metadata field in an HTTP request or response that conveys information about the message or its processing.
- ASP.NET Coreuses · ASP.NET Core is Microsoft’s cross-platform, open-source framework for building web applications and services on the .NET platform.
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.





