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.
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
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
url | query|body | string | no | Public API URL to test (http / https). Omit to simulate from pasted headers. | |
origin | query|body | string | yes | Origin of the calling page, e.g. https://app.example.com. | |
method | query|body | string | no | GET | HTTP method the page uses (alias http_method). |
headers | query|body | string | no | Comma-separated request header names, e.g. Authorization, Content-Type. | |
content_type | query|body | string | no | Content-Type sent (form / text types do not need a preflight; default application/json when Content-Type is listed). | |
credentials | query|body | boolean | no | Cookies / credentials: include are sent. | |
private_network | query|body | boolean | no | The target is on a private network (Private Network Access). | |
preflight_headers | body | object | no | Simulation: preflight response headers (object or "Name: value" lines); preflight_status (default 204). | |
response_headers | body | object | no | Simulation: 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: *"}'const res = await fetch('https://apibox.io.vn/v1/cors-check', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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: *"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/cors-check",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"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: *"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/cors-check');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"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 = curl_exec($ch);
print_r(json_decode($response, true));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
URL Metadata
Fetch any URL and get its title, description, Open Graph and Twitter Card tags, favicon, canonical, feeds and JSON-LD as JSON.
H:HTTP Headers
See the HTTP status and every response header of a URL, with a summary of security headers like HSTS, CSP and X-Frame-Options.
301Redirect Checker
Follow every 301, 302, 307 and 308 redirect of a URL and get the full chain with status codes, the final URL and the number of hops.