CORS Checker API

Send a real CORS preflight and request to an API for your origin, method, headers and credentials; get the browser verdict, the reason and server fixes.

GETPOSThttps://apibox.io.vn/v1/cors-check

Give the API url, the page origin, the method, the request headers and whether credentials (cookies, credentials: include) are sent. The service decides like a browser (Fetch Standard): is it a simple request or does it need a preflight (and why), then sends a real OPTIONS preflight with Origin / Access-Control-Request-Method / -Headers (and -Private-Network when private_network=1) and a GET / HEAD probe with the Origin header. Redirects are not followed — a preflight must not redirect — and private / local addresses are refused.

You get allowed, a one-line verdict in English and Vietnamese and every problem explained: missing Access-Control-Allow-Origin, origin mismatch (exact scheme / host / port, trailing slash), several origins, * with credentials, missing Allow-Credentials, method or header not allowed (* never covers Authorization), preflight status not 2xx or redirected, missing Vary: Origin (cache poisoning between origins), Private Network Access, short preflight caching, exposed headers. When blocked, ready-to-paste fixes for nginx, Express (cors), Cloudflare Workers, Laravel and Apache are included.

Methods other than GET / HEAD are never sent for real (no side effects on your API): the preflight decides, and the response headers come from a GET to the same URL. Without url, paste preflight_headers / response_headers to simulate offline.

Markdown · OpenAPI · Postman · llms.txt

Parameters

NameInTypeRequiredDefault
urlquery|bodystringnoPublic API URL to test (http / https). Omit to simulate from pasted headers.
originquery|bodystringyesOrigin of the calling page, e.g. https://app.example.com.
methodquery|bodystringnoGETHTTP method the page uses (alias http_method).
headersquery|bodystringnoComma-separated request header names, e.g. Authorization, Content-Type.
content_typequery|bodystringnoContent-Type sent (form / text types do not need a preflight; default application/json when Content-Type is listed).
credentialsquery|bodybooleannoCookies / credentials: include are sent.
private_networkquery|bodybooleannoThe target is on a private network (Private Network Access).
preflight_headersbodyobjectnoSimulation: preflight response headers (object or "Name: value" lines); preflight_status (default 204).
response_headersbodyobjectnoSimulation: actual response headers; response_status (default 200).

Example

curl -X POST "https://apibox.io.vn/v1/cors-check" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin":"https://app.example.com","method":"PUT","headers":"Authorization, Content-Type","credentials":"true","preflight_headers":"Access-Control-Allow-Origin: *\nAccess-Control-Allow-Methods: GET, POST\nAccess-Control-Allow-Headers: *","response_headers":"Access-Control-Allow-Origin: *"}'

Response

{
  "mode": "simulated",
  "origin": "https://app.example.com",
  "method": "PUT",
  "credentials": true,
  "request_type": "preflighted",
  "preflight_reasons": [
    "method PUT is not GET / HEAD / POST",
    "header(s) authorization, content-type are not CORS-safelisted (Content-Type application/json is only safelisted for form / text types)"
  ],
  "allowed": false,
  "preflight_ok": false,
  "response_ok": false,
  "exposed_headers": [],
  "problems": [
    {
      "code": "preflight-wildcard-credentials",
      "severity": "error",
      "message": "Access-Control-Allow-Origin is \"*\" but the request sends credentials (cookies / Authorization with credentials: include): the server must echo the exact origin",
      "message_vi": "Access-Control-Allow-Origin là \"*\" nhưng request gửi kèm credentials (cookie, credentials: include): server phải trả đúng origin cụ thể"
    },
    {
      "code": "method-not-allowed",
      "severity": "error",
      "message": "Method PUT is not in Access-Control-Allow-Methods (GET, POST)",
      "message_vi": "Phương thức PUT không có trong Access-Control-Allow-Methods (GET, POST)"
    },
    {
      "code": "header-not-allowed",
      "severity": "error",
      "message": "Request header \"authorization\" is not in Access-Control-Allow-Headers (*); \"*\" never covers Authorization: list it explicitly",
      "message_vi": "Header \"authorization\" không có trong Access-Control-Allow-Headers (*); \"*\" không bao gồm Authorization: phải ghi rõ"
    },
    "…"
  ],
  "verdict": "Blocked: Access-Control-Allow-Origin is \"*\" but the request sends credentials (cookies / Authorization with credentials: include): the server must echo the exact origin",
  "verdict_vi": "Bị chặn: Access-Control-Allow-Origin là \"*\" nhưng request gửi kèm credentials (cookie, credentials: include): server phải trả đúng origin cụ thể",
  "preflight": {
    "status": 204,
    "headers": {
      "access-control-allow-origin": "*",
      "access-control-allow-methods": "GET, POST",
      "access-control-allow-headers": "*"
    }
  },
  "response": {
    "status": 200,
    "headers": {
      "access-control-allow-origin": "*"
    }
  },
  "fixes": {
    "express": "import cors from 'cors';\napp.use(cors({\n  origin: ['https://app.example.com'],\n  methods: ['GET', 'POST', 'OPTIONS', 'PUT'],\n  allowedHeaders: ['Authorization', 'Content-Type'],\n  credentials: true,\n  maxAge: 7200,\n}));\n// before auth middleware, so OPTIONS is answered without a token",
    "nginx": "…",
    "cloudflare_workers": "…",
    "laravel": "…",
    "apache": "…"
  },
  "spec": "https://fetch.spec.whatwg.org/#http-cors-protocol"
}

Use cases

  • Find out why the browser says "blocked by CORS policy" for your front-end
  • Check an API before giving it to customers that call it from browsers
  • Verify CORS after changing nginx, a CDN or a WAF
  • Explain CORS errors to no-code users (Bubble, FlutterFlow) with a fix

FAQ

Does it send my PUT / DELETE request?

No. Only the OPTIONS preflight and a GET (or HEAD) are sent, so nothing changes on your server.

Why can a request work in Postman but fail in the browser?

CORS is enforced by browsers only; the server must answer the browser’s Origin with the right Access-Control-* headers, which this check shows.

Can I test localhost or an intranet API?

Not through the live check (private addresses are blocked); paste the response headers to simulate instead.

Related APIs

Start with 1,000 free requests every month. Get free API key →