Skip to content
Commitwise
Menu

CORS

Also called: Cross-Origin Resource Sharing, Preflight

Cross-Origin Resource Sharing: headers with which a server allows pages from other origins to read its responses.

Definition

The browser sends an Origin header; the server answers with Access-Control-Allow-Origin. Requests beyond simple forms (JSON, Authorization, PUT, DELETE) are preceded by an OPTIONS preflight. Credentials require an exact origin, never *. Simple requests are still sent when CORS fails, so CORS is not access control for the server.

In practice

Access-Control-Allow-Origin: https://shop.example with Access-Control-Allow-Credentials: true and Vary: Origin.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.