CORS Blocked — Missing Allow-Origin Header

The most common CORS error explained step by step — the request reaches the server fine, but the browser blocks your code from reading the response. See exactly where it fails.

Scenario presets

Request — the browser (page) side

Method

Content-Type

Custom header

Response — headers the server sends

Access-Control-Allow-Origin

Access-Control-Allow-Methods

Access-Control-Allow-Headers

Headers the request needs + common values — click to toggle

Browser processing steps

→

Page issues a fetch request

•

Simple request (CORS-safelisted) — sent directly, no preflight

→

Actual request sent

GET /data HTTP/1.1
Origin: https://myapp.example.com
Content-Type: text/plain
←

Server's actual response arrives

HTTP/1.1 200 OK

{"status": "ok"}
✗

No Access-Control-Allow-Origin header in the response

✗

Browser blocks the response and rejects the fetch

Browser console

✕ Access to fetch at 'https://api.example.com/data' from origin 'https://myapp.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

(index):1

Change any value and the steps below recompute instantly. Try the 'credentials + *' scenario to see why the wildcard fails.

'Access to fetch ... blocked by CORS policy: No Access-Control-Allow-Origin header' is the classic CORS error. The request was sent and processed — but the response lacked the header, so the browser refuses to hand it to JavaScript.

The blocker is the browser, not the server — which is why curl and Postman work fine. CORS doesn't reject your request; it blocks your page from reading a cross-origin response the server didn't explicitly share.

The only real fix is server-side: add Access-Control-Allow-Origin with either your exact origin or * for public APIs. no-cors mode and proxy hacks are workarounds, not fixes. CORS Simulator

Frequently asked questions

It works in Postman but fails in the browser — why?
CORS is browser-only. Postman and curl don't intercept responses, so they show the result regardless. The server answered fine — the browser blocked your page from reading it. Add the ACAO header on the server.
Does mode: 'no-cors' fix it?
The request goes out but the response becomes opaque — you can't read the body or even the status code. It's not a real solution.
Can I fix CORS from the frontend?
No — permission is granted only via server response headers. For development, use a same-origin dev proxy or serve the API from your domain.

Other scenarios