Skip to main content

CORS Headers Checker

Test CORS policy for any API endpoint. Inspect Access-Control-Allow-Origin, methods, headers, and credentials. Get an instant verdict and server config snippets.

✓ Analyzes all CORS headers ✓ OPTIONS preflight support ✓ Nginx / Express fix snippets ✓ Credentials & wildcard validation

Frequently Asked Questions

What is CORS and why does it matter?▼

CORS (Cross-Origin Resource Sharing) is a browser security mechanism that controls how web pages can make requests to a different domain, protocol, or port than the one that served the page. Without CORS headers, browsers block cross-origin requests by default. If your API needs to accept requests from a frontend at a different domain, the API server must include the correct Access-Control-Allow-Origin header.

What is the Access-Control-Allow-Origin header?▼

Access-Control-Allow-Origin tells the browser which origins are allowed to read the response. Setting it to * allows all origins but disables credentials. Setting it to a specific origin (e.g., https://yourapp.com) allows only that origin. If this header is missing or doesn't match the requesting origin, the browser blocks the response — even if the request succeeded on the server.

What is an OPTIONS preflight request?▼

For 'non-simple' requests (non-GET/POST, custom headers, or content-type: application/json), browsers first send an OPTIONS preflight to check if the server permits the actual request. The server must respond with Access-Control-Allow-Methods and Access-Control-Allow-Headers. If the preflight fails, the actual request is never sent. Caching preflight responses with Access-Control-Max-Age reduces latency.

Why does Access-Control-Allow-Origin: * break with credentials?▼

The CORS spec explicitly forbids using wildcard (*) with Access-Control-Allow-Credentials: true. When credentials (cookies, auth headers) are included in a cross-origin request, the browser requires the server to echo back the exact requesting origin — not *. Use a dynamic origin allowlist on the server instead: check the incoming Origin header and echo it back if it's on your whitelist.

What does Access-Control-Expose-Headers do?▼

By default, the browser only exposes a small set of response headers (like Content-Type) to JavaScript. Access-Control-Expose-Headers lists additional headers that should be accessible via response.headers.get() — for example, custom headers like X-Request-Id, X-Rate-Limit-Remaining, or Link for pagination. Headers not in this list are invisible to client-side code even if present in the response.

How do I fix CORS errors in nginx, Express, or FastAPI?▼

Nginx: add add_header Access-Control-Allow-Origin "https://yourapp.com"; to your server block. Express: use the cors() middleware (npm install cors) with the origin option. FastAPI: add CORSMiddleware with allow_origins. For dynamic origins, check the incoming Origin header against a whitelist and echo it back. Never use * in production APIs that handle authenticated requests.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Webhook Tester CORS Policy Builder OpenAPI Validator HTTP Status Code Reference API Request Builder API Response Mock Generator HTTP Status Code Reference WebSocket Tester WebP Converter HTTP Status Code Lookup WebSocket Test Client HTTP Status Code Lookup API Response Time Tester HTTP Methods Reference CORS Header Analyzer OpenAPI Schema Validator CORS Policy Tester OpenAPI Mock Generator API Test Case Generator Core Web Vitals Guide HTTP Headers Analyzer API Response Formatter & Analyzer HTTP API Tester HTTP Security Headers Generator HTTP Status Code Reference Web Vitals Scorer CORS Policy Validator HTTP Header Analyzer Web Vitals Analyzer API Mock Server Config Generator REST API Request Builder HTTP Security Headers Checker API Response Mocker Core Web Vitals Budget Calculator API Rate Limit Calculator CORS Tester CORS Header Tester HTTP Headers Inspector HTTP Code Snippet Generator PWA Manifest Generator HTTP Mock Response Builder LLM Cost Calculator Caddy Caddyfile Generator HTTP Cache-Control Builder WASM Module Explorer AI Prompt Cost Calculator HTTP/2 Server Push Headers Builder Lighthouse Score Simulator nginx Config Builder Mock Service Worker (MSW) API Mocking Guide Core Web Vitals Calculator Content Security Policy Builder LLM Prompt Cost Calculator HTTP Header Inspector AI Rate Limit Calculator WebAssembly Binary Inspector Web Vitals Budget Planner HTTP Cache Header Builder Prompt Injection Tester GCP Service Account Key Auditor Web Performance Checklist Image Optimizer Checklist API Key Generator AI Doc Generator — Pro Tool AI System Guardian Color Blindness Simulator curl Command Builder .htaccess Generator JSON Diff Viewer JSON Diff JWT Builder JWT Decoder nginx Config Generator Password Strength Checker Developer Utilities Rate Limiter Tester API Changelog Generator Service Worker Generator HMAC Generator CSP Header Builder Rate Limit Calculator AWS IAM Policy Validator Haproxy Config Validator WCAG Contrast Checker HTTP Cookie Parser HAR Diff Analyzer SBOM Generator JWT Debugger Pro Vue Component Generator LLM Context Window Calculator LLM Token Counter Dockerfile Linter Bundle Size Estimator SSL Certificate Checker Prompt Token Estimator Pulumi Modern IaC Guide Docker Layer Optimizer Bundle Size Impact Calculator HTML5 Canvas API Playground Token Context Calculator OpenAI Function Calling Generator TTFB Analyzer Token Counter & Cost Estimator AI API Rate Limit Calculator Password Strength Analyzer JWT Decoder & Validator

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →