CORS Builder.

Generate correct Access-Control-* headers for your server, with plain-English explanations and checks for the dangerous combinations — then paste a real endpoint's response headers to see whether a browser would actually allow a given request.

Allowed origins

AllowlistReflect (echo if allowed)Any (*)
An origin is scheme + host (+ optional port), no path or trailing slash.

Methods

GETHEADPOSTPUTPATCHDELETEOPTIONS

Allowed request headers

Content-TypeAuthorizationX-Requested-WithAcceptOriginX-CSRF-Token

Options

Comma-separated. Response headers JS may read via getResponseHeader().
headers.txt

    The CORS rules that trip people up

    Wildcard ✕ credentials

    Access-Control-Allow-Origin: * is invalid once a request carries cookies. Echo the exact request Origin and add Allow-Credentials: true — for trusted origins only.

    Reflecting the Origin

    Blindly echoing back whatever Origin arrives, with credentials, lets any site read authenticated responses. Always check against an allowlist first.

    Preflights & Vary: Origin

    Non-simple methods or custom headers cause an OPTIONS preflight. When the allowed origin is dynamic, send Vary: Origin so caches don't cross the streams.