liveBook · Manning

CORS

Also called cross-origin resource sharing

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.

How 8 Manning books explain it

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 to access an API at another origin under an explicit policy.
How deep it goes
Explains origins, response headers, preflight, and policy configuration while leaving detailed specification mechanics to the framework.
Examples
Uses a shopping site and product API to demonstrate a named origin policy and global middleware configuration.
What you can do after
Operate/configure CORS using ASP.NET Core policies, middleware, and endpoint metadata.

Read how ASP.NET Core in Action, 3e explains CORS →

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 →

Acing the Frontend Interview

Cross-Origin Resource Sharing is a browser and HTTP mechanism that controls whether a web origin may access resources from another origin.

How it is used
Handles browser access between separately deployed frontend and backend tiers in distributed web architectures.
How deep it goes
Explains same-origin policy, response headers, credentials, preflight handling, curl verification, and a development proxy.
Examples
Uses an Express middleware configuration, an OPTIONS curl response, and a React + Vite proxied dog-image request.
What you can do after
Configure CORS headers, handle preflight requests, verify responses, and apply a React + Vite API proxy.

Read how Acing the Frontend Interview 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 access to a local API from a separately served web page and dashboard.
How deep it goes
Explains response headers and middleware settings, with basic troubleshooting and a note on preflight OPTIONS behavior.
Examples
Uses a localhost health-check request and a dashboard configuration with GET and POST.
What you can do after
Operate/configure FastAPI CORS middleware for expected origins and methods, and diagnose common local request errors.

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.

Read how Spring in Action, Sixth Edition explains CORS →

Vanilla Web

Cross-origin resource sharing is a web mechanism through which servers use HTTP headers to specify which other origins may access their resources.

How it is used
Enables controlled access to APIs and assets from other origins while retaining the browser’s default same-origin isolation.
How deep it goes
Defines the server-header requirement and explains credentialed fetch behavior, without a step-by-step server configuration.
Examples
Contrasts same-origin and cross-origin account fetches, and identifies a cross-origin module request blocked without CORS headers.
What you can do after
Operate/configure it by setting server response headers and selecting an appropriate fetch credentials mode for cross-origin requests.

Read how Vanilla Web explains CORS →

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.

Read how Rust Web Development explains CORS →

Also covered in

What to know first

Related concepts

Questions about CORS

What is 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.

Which Manning books explain CORS?

ASP.NET Core in Action, 3e, Building Web APIs with ASP.NET Core, Spring Security in Action, Second Edition, Acing the Frontend Interview, Build Financial Software with Generative AI (From Scratch), Spring in Action, Sixth Edition, Vanilla Web and Rust Web Development.

What should I know before learning CORS?

Manning books that teach CORS usually introduce HTTP, cookie, cross-origin request and OPTIONS first.

What is CORS also called?

CORS is also called cross-origin resource sharing.

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.