CORS Handbook
The complete guide to understanding and fixing CORS errors.
Built by headertest.com
CORS: The Complete Handbook for Modern Web APIs Cross-Origin Resource Sharing, or CORS, is one of the most misunderstood parts of web development. Teams lose hours to it because the browser error messages feel vague, framework defaults vary wildly, and many blog posts reduce the topic to “just add Access-Control-Allow-Origin: *”. That advice is often wrong. CORS is not an authentication system, not a CSRF defense, and not a server-to-server access control mechanism. It is a browser-enforced policy layer that decides whether frontend JavaScript running on one origin may read a response from another origin. ...
I’ve seen a weird pattern with CORS on AWS projects: the infrastructure is “fully automated,” but CORS is still handled like a last-minute checkbox. Somebody adds '*', the browser still fails, and the team burns half a day staring at DevTools. This case study is from a setup that’s very common: React frontend hosted on S3 + CloudFront API on API Gateway + Lambda Infrastructure managed with AWS CDK in TypeScript Cookies used for auth in production Separate frontend domains for local, staging, and prod The team thought they had CORS configured. They did not. ...
CORS problems on OVH usually aren’t really “OVH problems.” They’re deployment-shape problems: shared hosting with Apache overrides, VPS setups with Nginx in front of PHP-FPM, CDN or reverse proxy layers, and apps that work locally but break once a browser starts sending preflights. I’ve seen the same mistakes over and over. The browser says “blocked by CORS policy,” people start randomly adding Access-Control-Allow-Origin: *, and things get worse. Here’s the stuff that actually breaks on OVH deployments, and how to fix it. ...
Browsers are brutally strict about CORS, and Istio adds one more layer where things can go wrong. I’ve seen teams burn hours debugging a “backend bug” that was really just Envoy rejecting a preflight, or a VirtualService that looked right but matched the wrong route. If you run APIs behind Istio, CORS usually fails in a few predictable ways. The good news: once you know where Istio evaluates CORS and how route matching works, most fixes are straightforward. ...
Payment integrations are where sloppy CORS decisions turn into outages, failed checkouts, or security reviews nobody wants to sit through. I’ve seen teams assume CORS is just a browser checkbox: add Access-Control-Allow-Origin: *, ship it, done. That logic falls apart fast in payments. Gateways deal with tokens, client secrets, redirects, idempotency keys, fraud signals, and sometimes session cookies. The browser is the least trustworthy place in that chain, so your CORS policy has to reflect that. ...
Electron makes CORS weird in a very specific way: you’re building a desktop app, but a big chunk of your UI still runs inside Chromium. That means you get browser security rules in places you might not expect, and Node-style power in places you definitely need to treat carefully. I’ve seen a lot of Electron apps “solve” CORS by disabling web security or turning on nodeIntegration everywhere. That works right up until you ship something that can load remote content, gets XSS’d, and suddenly your desktop app becomes a local file and credential exfiltration machine. ...
If you’re wiring a frontend to the Shopware API and the browser starts yelling about CORS, the problem usually isn’t Shopware itself. It’s the config around it: reverse proxies, app servers, auth headers, cookies, and preflight handling. I’ve seen teams lose hours on this because the API works fine in Postman, curl, or the Shopware admin, but fails instantly in the browser. That gap is the whole CORS story: browsers enforce it, backend clients don’t. ...
Safari is where “my CORS setup is fine” goes to die. I’ve seen teams burn hours staring at Access-Control-Allow-Origin headers while the real problem was Safari’s privacy model, cookie policy, or a cross-site storage assumption that worked everywhere else. If you build anything involving frontend apps, APIs, auth, embedded widgets, or third-party dashboards, you need to treat Safari as a separate threat model and a separate testing target. CORS is only one layer. Safari’s Intelligent Tracking Prevention (ITP) changes the behavior around cookies, storage, and cross-site identity, which means a request can be perfectly valid from a CORS perspective and still fail in practice. ...
Strapi preview sounds simple until the browser gets involved. You have Strapi running on one origin, a frontend preview app on another, and an editor clicking “Preview” expecting instant results. Then the browser blocks your request because of CORS, cookies don’t stick, or your preview token leaks across environments. I’ve seen teams lose hours here because they treat CORS as a checkbox instead of a design choice. For Strapi preview, your CORS setup affects security, editor experience, and how much pain you’ll have when moving from local dev to staging and production. ...
gRPC-Web looks simple on the surface: your browser app makes RPC calls, your backend answers, everybody wins. Then CORS shows up and turns a clean protocol choice into a deployment problem. I’ve hit this enough times to have a strong opinion: CORS for gRPC-Web is less about “turning on cross-origin access” and more about choosing where protocol translation and policy enforcement should live. That choice affects debugging, security posture, local development, and whether your frontend team hates you by Friday. ...