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.
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.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
Webhook Tester
Generate realistic webhook test payloads for GitHub, Stripe, Slack, and custom services. Get a curl command to send the payload to your local endpoint. Inspect headers, payload size, and content-type.
Open free tool →
CORS Policy Builder
Generate CORS configuration for Express.js, Nginx, FastAPI, Django, Koa, Laravel, and Spring Boot. Set allowed origins, methods, headers, credentials, and max-age.
Open free tool →
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
More Free Tools
Related Articles
Base64 Encode/Decode Explained: When and How to Use It
Understand when to use Base64 encoding and when to avoid it. This guide explains the Base64 algorithm, practical use cases, code examples in JavaScript, Python, Go, and more.
JWT Token Decoder: How to Debug Authentication Issues
Learn how to use a JWT token decoder to diagnose 401 errors, expired tokens, missing claims, and auth misconfiguration. Practical debugging guide with code examples.
Base64 Decode Online: Instantly Decode Any Base64 String for Free
Decode Base64 strings instantly online — JWT payloads, API image data, env vars, and SSH keys. No install needed, no account. URL-safe variant supported.
Base64 Encoding and Decoding Explained for Developers
Understand Base64 encoding and decoding from the ground up. Learn when to use it, how it works, common pitfalls, and how to encode/decode instantly online.
Base64 Encoding Explained: When to Use It and When to Avoid It
Base64 encoding explained: when to use it in APIs, image data URIs, and auth tokens. Real-world examples and common pitfalls for web developers.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →