Skip to main content

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.

✓ Real browser requests ✓ Preflight simulation ✓ Header analysis & issues

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

Disclosure

Affiliate disclosure: some links below may earn us a small commission at no cost to you. Learn more

Need to inspect HTTP response headers in detail?

HTTP Headers Inspector →
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 Security Headers 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 HTTP Security Headers Checker 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 Status Code Reference Web Vitals Scorer CORS Policy Validator HTTP Header Analyzer HTTP/2 Server Push Headers Builder Web Vitals Analyzer API Mock Server Config Generator REST API Request Builder API Response Mocker HTTP Header Inspector HTTP Cache Header Builder Core Web Vitals Budget Calculator API Rate Limit Calculator CORS 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 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 AI Rate Limit Calculator WebAssembly Binary Inspector Web Vitals Budget Planner 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 CORS Headers Checker Docker Layer Optimizer Bundle Size Impact Calculator HTML5 Canvas API Playground Token Context Calculator GraphQL Client Configurator 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 →