MORTIMERDEV LABS / CORS FREE · BETA

Why is my request blocked?
CORS, explained step by step.

Describe the request and paste the server’s response headers. See whether the browser sends a preflight, exactly which rule blocks it, what your code can read, and the headers and config that fix it.

Runs in your browser. Nothing is fetched or uploaded.
Take the 10-question quiz

Check a request

The request

The server’s answer

Copy them from DevTools (Network tab: select the request, then the OPTIONS row for the preflight) or curl -i.

Placeholders are fine: CORS only cares which headers are sent, not their values (apart from Content-Type). Leave real tokens and cookies out.

TEST YOURSELF

How well do you know CORS?

Ten questions, picked at random, with an explanation and a link to the reference after each one. Some are worked out live by the same engine as the checker.

CORS REFERENCE

Every CORS header, in plain English.

The ideas

Same originScheme, host and port all match. CORS only applies when they don’t.

https://app.example.com and https://api.example.com are different origins, and so are http:// and https://, or :443 and :8443. Default ports count as the same. Subdomains of the same site are still cross-origin, even though they’re “same-site” for cookies.

Simple requestGET, HEAD or POST with only safelisted headers: sent straight away, no preflight.

Because it’s sent immediately, the server receives and acts on a simple request even if the browser then blocks the response. CORS protects the response from being read; it doesn’t stop the request. Protect state-changing endpoints with CSRF defences, not CORS.

Safelisted request headersAccept, Accept-Language, Content-Language, Content-Type (three types only) and simple Range.

Content-Type is only safelisted for application/x-www-form-urlencoded, multipart/form-data and text/plain, so application/json always needs a preflight. Values must be 128 characters or fewer and avoid certain characters, and all safelisted values together must be 1,024 or fewer. Any other header, including Authorization and X-Requested-With, triggers a preflight.

Preflight requestAn OPTIONS request the browser sends first, asking whether the real request is allowed.

It carries Origin, Access-Control-Request-Method and Access-Control-Request-Headers, never cookies or your Authorization header. The response must be 2xx and allow the origin, method and headers, or the real request is never sent. Common failures: no OPTIONS route (404/405), or auth middleware rejecting it (401).

CredentialsCookies, HTTP auth and client certificates, sent with credentials: "include" (or withCredentials).

fetch() defaults to "same-origin", which sends no cookies cross-origin. With "include", the server must send the exact origin (not *) and Access-Control-Allow-Credentials: true, and * stops working in Allow-Methods, Allow-Headers and Expose-Headers. Cookies also need SameSite=None; Secure, and may still be blocked as third-party cookies.

Opaque response (no-cors)mode: "no-cors" sends the request but hides the response: status 0, no headers, no body.

It doesn’t get around CORS. It only allows simple requests and is useful for things like caching third-party resources in a service worker. If you need the data, the server has to send CORS headers.

Request headers

OriginSent by the browser on cross-origin requests: the page’s scheme, host and port.

Scripts can’t set or change it. The server compares it with its allow-list and echoes it back in Access-Control-Allow-Origin. Pages from file:// and sandboxed iframes send Origin: null; don’t allow null, since any sandboxed page can send it.

Access-Control-Request-MethodIn a preflight: the method the real request will use.

fetch() uppercases DELETE, GET, HEAD, OPTIONS, POST and PUT, but sends anything else as written, so method: "patch" is sent as patch and won’t match PATCH in Access-Control-Allow-Methods.

Access-Control-Request-HeadersIn a preflight: the non-safelisted headers the real request will send, lowercase and sorted.

The server must allow every name listed, in Access-Control-Allow-Headers.

Response headers

Access-Control-Allow-OriginWhich origin may read the response: one exact origin, or * for any (without credentials).

Only one value is allowed; a comma-separated list never matches. To allow several origins, check the request’s Origin against an allow-list and echo back the match, with Vary: Origin. The comparison is exact: no trailing slash, same case, same port.

Access-Control-Allow-CredentialsMust be exactly true for credentialed requests to be readable.

Any other value, including True or 1, counts as not allowed. Leave it out entirely when you don’t use credentials.

Access-Control-Allow-MethodsOn the preflight: methods allowed for the real request. GET, HEAD and POST are always allowed.

Matching is case-sensitive. * allows any method, but only without credentials.

Access-Control-Allow-HeadersOn the preflight: request headers the real request may send.

Names are case-insensitive. * allows any header except Authorization, which must always be listed by name, and * stops working with credentials.

Access-Control-Expose-HeadersResponse headers your code may read beyond the default seven.

By default only Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified and Pragma are readable; response.headers.get() returns null for anything else, like X-Total-Count or Link. * exposes all (except Set-Cookie) without credentials. Set-Cookie is never readable.

Access-Control-Max-AgeOn the preflight: how long the browser may reuse it, in seconds.

The default is 5 seconds. Chrome caps it at 7200 (2 hours) and Firefox at 86400 (24 hours). Setting it saves a round trip on repeat requests.

Vary: OriginTells caches the response depends on the request’s Origin.

If you echo the origin in Access-Control-Allow-Origin, add Vary: Origin, or a CDN or browser cache may serve the response for one origin to another, which then fails CORS. Not needed for a fixed * response.

Follows the Fetch standard.

The checks follow the CORS rules in the WHATWG Fetch standard, the spec browsers implement: safelisted headers, method matching, wildcards and credentials. Where browsers differ, like preflight caching limits, results say so.

Nothing leaves this page.

The checker doesn’t contact your server. It works only from what you paste, so it can’t see redirects or network errors. We count anonymous page views and button use, never what you enter.