Skip to content
Zesona
CORS Header BuilderLocal

CORS Header Builder

Build CORS response headers and catch the configuration mistakes that browsers reject or that expose your API.

  • Free
  • No sign-up
  • Runs in your browser

Input

Runs in your browser

Exact origins: scheme, host and port, no trailing slash.

Sends cookies and HTTP auth. Cannot be combined with a wildcard origin.

Ready

Everything happens on this device. No upload, no account, no network request.

How to use this tool

  1. 1

    List the exact origins your frontend is served from. The bare domain and the www form are different origins to a browser.

  2. 2

    Copy the generated headers into your server configuration - and return them on the OPTIONS preflight too, not only on the real request.

Questions about CORS Header Builder

Why can I not use a wildcard with credentials?

Because the browser refuses that combination outright - it is a deliberate safety rule. `Access-Control-Allow-Origin: *` with `Allow-Credentials: true` would let any site make authenticated requests with the visitor’s cookies. Compare the request’s Origin against an allowlist and echo back the matching one instead.

Why is my CORS still failing?

Most often the preflight. The browser sends `OPTIONS` before any non-simple request, and if that returns 404, 405 or no CORS headers, the real request never happens. Second most common: the origin does not match exactly - a trailing slash, a missing port, or http against https.

Why can my JavaScript not read a response header?

Because only a handful are exposed by default (Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma). Anything else - including your own `X-Total-Count` - must be listed in `Access-Control-Expose-Headers`. The response arrives intact; the browser just hides those headers from script.

Does CORS protect my API?

No, and this is worth being clear about. CORS protects *browser users* from one site reading another site’s responses. It does nothing against curl, a script, or a server - none of them enforce it. Your API still needs real authentication and authorisation.

Is my data sent anywhere?

No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your input, nothing is written to a server log, and it keeps working with your connection switched off. You can confirm it in the browser’s network panel. That matters more here than elsewhere on the site: developer tools handle tokens, keys and production data.

Other tools you might reach for next.