CORS Checker - test preflight, Access-Control-Allow-Origin and credentials | POLPROG Skip to content

CORS Checker FREE

Find out whether a browser would let your code read an API response, and exactly which check blocks it. Real preflight and request diagnostics, not a header dump.

Free to use No registration Privacy-first
Describe the request your code makes

The URL is the endpoint your code calls. The origin is the site the code runs on, which is a scheme, host and port with no path.

Advanced options
Request headers

Add the headers your code sets. For preflight analysis the name is what matters: the browser announces the name, never the value, so a token is not needed and should not be pasted here.

Common:
What to test

One origin per line, up to ten. Useful for checking that local, staging and production are all on the allowlist. The results appear as a table in the Headers tab.

These requests are sent from POLPROG servers to the endpoint you name, because a browser cannot run this diagnosis on itself: CORS is what would block it. No cookie of yours is forwarded, no request body is ever sent, response bodies are discarded, and nothing is stored once the report reaches you.

Reference

CORS, briefly

01

What CORS is

A browser rule, not a server one. When JavaScript on one origin asks for a resource on another, the browser sends the request but refuses to hand the response to your code unless the server says, in its response headers, that the requesting origin may read it. Cross-Origin Resource Sharing is the set of headers used to say that.

02

It is enforced by browsers and nothing else

If a request works in curl, Postman, Insomnia or from your own backend, that tells you nothing about whether browser JavaScript can read it. Those clients apply no CORS rules at all. The server usually behaves identically in both cases; the difference is entirely in what the caller does with the response.

03

What a preflight is

For anything but the simplest requests, the browser first sends an OPTIONS request asking whether the real one is permitted. It carries Origin, Access-Control-Request-Method and, if needed, Access-Control-Request-Headers. If the answer does not permit the request, the real one is never sent, so the endpoint never sees it and your server logs show nothing.

04

Which requests avoid a preflight

A request is simple only when its method is GET, HEAD or POST and every header it sets is CORS-safelisted: Accept, Accept-Language, Content-Language, Content-Type and Range. The value matters too. Content-Type stays safelisted only for application/x-www-form-urlencoded, multipart/form-data and text/plain.

05

Why application/json triggers a preflight

It is not on the list of three safelisted content types. That is the whole reason. A POST with a JSON body is a preflighted request, which is why adding a JSON API to an existing page suddenly produces an OPTIONS request nobody wrote, and errors from a route that only handles POST.

06

Access-Control-Allow-Origin

Either a single origin or *. Never a list, never a value with a path, never a wildcard inside a hostname. The comparison against the requesting origin is exact, so a trailing slash, a default port written out, or http where the request used https will all fail while looking identical to a person.

07

Access-Control-Allow-Credentials

Needed when the request sends cookies or HTTP authentication. Its only accepted value is the exact lowercase string true. A credentialed request also cannot be satisfied by Access-Control-Allow-Origin: *, and for the same request an asterisk in Allow-Methods, Allow-Headers or Expose-Headers stops being a wildcard and becomes a literal name.

08

Why Vary: Origin matters

If the server picks the Allow-Origin value from the incoming request, the response depends on the Origin header, and any shared cache needs telling. Without Vary: Origin a CDN or reverse proxy can store a response naming one origin and serve it to another, so requests fail for reasons that never appear in the application.

09

Reading response headers

A cross-origin response exposes only seven headers to script: Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified and Pragma. Anything else, including your own X- headers and Location, reads as null unless it is named in Access-Control-Expose-Headers. That header is about the response and is unrelated to Allow-Headers, which is about the request.

10

CORS is not authentication, authorization or CSRF protection

It decides which origins may read a response in a browser. It does not decide who may call an endpoint, it grants no permissions, and it does not stop cross-site request forgery: a CSRF attack does not need to read the response, so a strict CORS policy leaves it untouched. Keep authentication, authorization and CSRF tokens exactly as they were.

Scope and limits

What this analysis covers

Real requests, and the limits of what they show

Every verdict here comes from an actual exchange with the endpoint you named, evaluated against the Fetch standard rules a browser applies. It describes the endpoint as it answered POLPROG infrastructure at that moment: a server that varies its response by network, by region or by authentication may answer your browser differently. Timings are observed from our infrastructure and are not a browser measurement. Actual-request testing is off by default for methods that can change data, and no request body is ever sent.

Help

FAQ

Why does my API work in Postman but fail in the browser?

Because CORS is enforced by browsers and by nothing else. Postman, curl, Insomnia and your own backend apply no CORS rules at all, so they receive the response whatever headers it carries. The server usually behaves identically in both cases. The difference is entirely in what the caller does with the answer, and a browser refuses to hand it to your JavaScript unless the response says that origin may read it.

What is a preflight request?

An OPTIONS request the browser sends before the real one, to ask whether the real one is allowed. It carries Origin, Access-Control-Request-Method and, when needed, Access-Control-Request-Headers. If the answer does not permit the request, the real one is never sent, so your endpoint never sees it and your server logs show nothing. Only requests that are not simple are preflighted.

Why does application/json trigger a preflight when text/plain does not?

Content-Type is CORS-safelisted only for application/x-www-form-urlencoded, multipart/form-data and text/plain. Those three, and nothing else. A JSON body puts the request outside the safelist, so the browser announces it in advance. That is why adding a JSON API to an existing page suddenly produces an OPTIONS request nobody wrote.

Why can I not use Access-Control-Allow-Origin: * with credentials?

Because a response tied to a signed-in user must not be readable by every site that user visits. When a request sends cookies or HTTP authentication, the server has to name the origin it is trusting, and a browser rejects a wildcard outright, even alongside Access-Control-Allow-Credentials: true. The same applies to an asterisk in Allow-Methods, Allow-Headers and Expose-Headers: for a credentialed request each one is read as a literal header name rather than as a wildcard.

Does CORS protect my API?

No. CORS decides which origins may read a response inside a browser. It is not authentication, it grants no permissions, and it does not stop cross-site request forgery, because a CSRF attack does not need to read the response. Any client that is not a browser ignores it completely. Keep your authentication, your authorization checks and your CSRF tokens exactly as they are.

Where do these requests come from, and what is stored?

From POLPROG servers to the endpoint you name, because a browser cannot run this diagnosis on itself: CORS is what would block it. Only the headers needed for the analysis are sent, no cookie of yours is forwarded, no request body is ever sent, and response bodies are discarded. Nothing is stored once the report reaches you, and values of sensitive headers such as Authorization are never displayed or exported.

Build a better web, faster.

We build custom software and solutions tailored to your needs.

Get in touch