CORS Header Tester
Send real cross-origin requests from your browser, inspect Access-Control response headers,
and diagnose preflight failures. Find out exactly why a request is blocked — and what headers to add to fix it.
Frequently Asked Questions
What is CORS and why does it matter?▼
CORS (Cross-Origin Resource Sharing) is a browser security mechanism that restricts JavaScript from making requests to a different origin (domain, protocol, or port) than the page it loaded from. Servers must explicitly opt in by returning Access-Control-Allow-Origin and related headers. If they don't, the browser blocks the response — even if the server processed the request successfully.
What is a preflight request?▼
Before sending certain cross-origin requests (non-simple methods like PUT/DELETE, or custom headers), the browser sends an OPTIONS preflight request to ask the server if the actual request is allowed. The server must respond with appropriate Access-Control headers. If the preflight fails or returns wrong headers, the browser blocks the real request. GET and POST with standard content types are usually simple requests that don't trigger preflights.
Why do I get CORS errors even when the server returns 200?▼
CORS errors happen on the browser side — the server may have processed the request and returned 200, but if the response is missing Access-Control-Allow-Origin (or it doesn't match your origin), the browser blocks JavaScript from reading the response. The network tab shows 200, but your code gets a CORS error. The fix is always on the server side: add the correct CORS headers.
What's the difference between Access-Control-Allow-Origin: * and a specific origin?▼
Wildcard (*) allows any origin to read the response — fine for public APIs with no authentication. A specific origin (e.g. https://yourapp.com) restricts access to that domain. You cannot use * with Access-Control-Allow-Credentials: true — if you need cookies or auth headers in cross-origin requests, you must specify the exact origin and set Vary: Origin in the response.
How do I fix CORS in a Node.js / Express API?▼
Install the 'cors' npm package and add it as middleware: `app.use(cors({ origin: 'https://yourapp.com', credentials: true }))`. For development, you can use `origin: true` to mirror the request origin. Never use `origin: '*'` with credentials. Always whitelist specific origins in production.
Can I fix CORS from the frontend?▼
No — CORS headers must be set by the server. Frontend workarounds include: using a proxy (Nginx, Next.js rewrites, or a CORS proxy service) that forwards requests and adds headers, or configuring your dev server to proxy requests. In production, the correct fix is always to configure the target server or API to return the right Access-Control headers.
Sponsored
DisclosureAffiliate disclosure: some links below may earn us a small commission at no cost to you. Learn more
Deploy frontend apps in seconds. Zero config, global CDN.
Deploy free →Deploy any app or database with one click. No DevOps required.
Start free →Simple cloud hosting for developers. VPS, managed databases, and more.
Get $200 free →Need to inspect HTTP response headers in detail?
HTTP Headers Inspector →Related Products
on GumroadDeveloper 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 →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
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
HTTP Headers Explained: Security & Performance (2025)
A developer's guide to HTTP headers. Covers security headers (HSTS, CSP, CORS), performance headers (Cache-Control, ETag), and how to inspect headers with free tools.
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.
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
JWT Authentication Best Practices 2026: Secure Your API Tokens
Complete JWT security guide for 2026. Covers RS256 vs HS256 signing, token storage strategies, expiry and refresh token patterns, revocation, common vulnerabilities, and a production security checklist.
Web Security in 2026: CSP, CORS, and Modern Auth Patterns
Master content security policy, CORS configuration, and WebAuthn passkeys. Practical security patterns for modern web applications.
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 →