Skip to main content

CORS Tester

Send real cross-origin requests from your browser, inspect CORS response headers, and diagnose preflight issues. Understand exactly why a request is blocked — no proxy, no server needed.

✓ Real browser requests (no proxy) ✓ Preflight OPTIONS analysis ✓ Access-Control header breakdown

Frequently Asked Questions

What is CORS and why does it block requests?▼

CORS (Cross-Origin Resource Sharing) is a browser security mechanism that restricts web pages from making requests to a different origin (domain, protocol, or port) than the one that served the page. Browsers enforce this to prevent malicious scripts from accessing sensitive data on other sites. The server must explicitly permit cross-origin requests by sending the correct Access-Control-Allow-Origin header.

What is a preflight request?▼

A preflight request is an HTTP OPTIONS request that browsers send automatically before certain cross-origin requests — specifically those using methods other than GET/POST, or custom headers. The server must respond with the correct Access-Control headers to signal that the actual request is allowed. If the preflight fails, the browser blocks the real request entirely.

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

When you send credentials (cookies, HTTP auth, or client-side certificates), browsers require Access-Control-Allow-Origin to be an explicit origin, not a wildcard (*). Additionally, the server must include Access-Control-Allow-Credentials: true. Using * with credentials is explicitly forbidden by the CORS spec — the browser will reject the response even if the server sends both.

How do I fix a CORS error on my API?▼

Add the correct Access-Control-Allow-Origin header to your API responses. For public APIs, use *. For credentialed requests, reflect the requesting origin dynamically. For preflight support, also handle OPTIONS requests and return Access-Control-Allow-Methods and Access-Control-Allow-Headers. Most frameworks have CORS middleware: Express (cors package), FastAPI (CORSMiddleware), Django (django-cors-headers), etc.

What CORS headers should my API return?▼

The minimum is Access-Control-Allow-Origin. For full functionality: Access-Control-Allow-Methods (e.g. GET, POST, PUT, DELETE, OPTIONS), Access-Control-Allow-Headers (e.g. Content-Type, Authorization), Access-Control-Allow-Credentials: true (if using cookies), Access-Control-Expose-Headers (for custom response headers your client needs to read), and Access-Control-Max-Age (cache duration for preflight results, e.g. 86400 for 24 hours).

Why can't I test CORS for localhost URLs in production tools?▼

Localhost URLs (http://localhost:*) are not reachable from external servers or most proxy-based testing tools. This tester sends requests directly from your browser, so localhost URLs work fine as long as the target server is running on your machine. No proxy is involved — your browser makes the actual cross-origin request.

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 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 →