DevToolsmith

Access-Control-Allow-Headers Header

The Access-Control-Allow-Headers response header lists the request headers a cross-origin request may send, in answer to a preflight.

Type
Response header
Category
CORS
Defined in
Fetch Standard

Syntax

Access-Control-Allow-Headers: <header>, <header>  |  *

How Access-Control-Allow-Headers works

Any request header outside a short safe list (Accept, Accept-Language, Content-Language, and Content-Type with form or text values) triggers a preflight, and must be listed here. The usual ones are Content-Type (for JSON) and Authorization.

Examples

JSON API with bearer tokens
Access-Control-Allow-Headers: Content-Type, Authorization

Common mistakes

  • * does not cover Authorization: it must always be listed by name.

Check it

curl -sI https://example.com | grep -i '^access-control-allow-headers:'

Paste a full set of response headers into the HTTP header checker to get every header explained and common mistakes flagged.

Related headers

More cors headers

Access-Control-Allow-Origin , Access-Control-Allow-Credentials , Access-Control-Max-Age , Origin .

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does the Access-Control-Allow-Headers header do?

The Access-Control-Allow-Headers response header lists the request headers a cross-origin request may send, in answer to a preflight. Any request header outside a short safe list (Accept, Accept-Language, Content-Language, and Content-Type with form or text values) triggers a preflight, and must be listed here. The usual ones are Content-Type (for JSON) and Authorization.

How do I see the Access-Control-Allow-Headers header?

Run "curl -sI https://example.com" to print a response’s headers, or open the Network tab in your browser’s dev tools and select the request. Paste the headers into the HTTP header checker on this site to get each one explained.