Access-Control-Allow-Headers Header Explained

What the HTTP Access-Control-Allow-Headers header does and when it's used.

Published October 15, 2026

Access-Control-Allow-Headers names the request headers a cross-origin client may send, such as Authorization or Content-Type.

How it works

The browser sends Access-Control-Request-Headers in the preflight; the server must allow them all.

The Access-Control-Allow-Headers header is part of the HTTP message and is case-insensitive in name.

In a real exchange

curl -i https://example.com/
Access-Control-Allow-Headers: Content-Type, Authorization
Where Access-Control-Allow-Headers appears.

Practical examples

The header

Access-Control-Allow-Headers: Content-Type, Authorization

Set or use it in code

res.set('Access-Control-Allow-Headers', 'Content-Type, Authorization')

Inspect it

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

Common mistakes

  • Forgetting Authorization or custom headers
  • Using * with credentialed requests (not allowed)
  • Not echoing requested headers

Key takeaways

  • Access-Control-Allow-Headers: Access-Control-Allow-Headers names the request headers a cross-origin client may send, such as Authorization or Content-Type.
  • Check it in browser DevTools → Network.
  • Test with curl -I before deploying.

FAQ

Why does Authorization fail with CORS?

It must be explicitly allowed here.

Is Access-Control-Allow-Headers case sensitive?

Header names are case-insensitive; values may not be.

More HTTP articles