DevKits

CORS · Response header

Access-Control-Allow-Origin

Which origins may read this response cross-origin.

What is Access-Control-Allow-Origin?

The core CORS header. `*` allows any origin (but blocks credentials); a specific origin like `https://app.example.com` allows only that one. Set on responses to preflight and simple cross-origin requests.

Typical usage

Required on any endpoint that browsers should call from another origin.

Examples

Allow any origin

Access-Control-Allow-Origin: *

Allow one origin

Access-Control-Allow-Origin: https://app.example.com

Common gotchas

You cannot combine `*` with `Access-Control-Allow-Credentials: true`. To send cookies cross-origin, echo the request Origin and set credentials true.

Specification

Fetch Standard §CORS

Related headers