CORS: The Complete Handbook for Modern Web APIs

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

March 29, 2026 · 26 min · headertest.com

CORS Mistakes on OVH Deployments and How to Fix Them

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

November 14, 2026 · 7 min · headertest.com

Istio CORS Mistakes and How to Fix Them

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

November 10, 2026 · 7 min · headertest.com

CORS for Payment Gateway Integrations: Pros, Cons, Patterns

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

November 9, 2026 · 7 min · headertest.com

CORS for Electron Applications

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

November 5, 2026 · 7 min · headertest.com

CORS for Strapi Preview: Options, Tradeoffs, and Pitfalls

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

October 30, 2026 · 7 min · headertest.com

CORS Mistakes with AWS Lambda Function URLs

AWS Lambda Function URLs are one of those features that feel almost suspiciously easy. Click a checkbox, get a public HTTPS endpoint, ship it. Then the browser starts yelling about CORS. I’ve seen this catch people because Function URLs blur two layers together: AWS can add CORS headers for you at the Function URL level. Your Lambda code can also return CORS headers. Mix those carelessly and you get flaky behavior, broken preflights, and confusing browser errors that look unrelated to the actual bug. ...

October 21, 2026 · 7 min · headertest.com

CORS Case Study: same-site vs same-origin confusion

A lot of CORS bugs are not really CORS bugs. They’re architecture bugs caused by mixing up same-origin and same-site, then trying to patch the fallout with headers until the browser stops complaining. I’ve seen this play out the same way more than once: frontend on app.example.com API on api.example.com session cookie involved somebody says “it’s the same domain, so it should work” someone else adds Access-Control-Allow-Origin: * auth breaks, or worse, security assumptions break Here’s a real-world style case study that shows how teams end up here, what the browser is actually doing, and what the fix looks like. ...

October 16, 2026 · 7 min · headertest.com

CORS for AWS CloudFront: Practical Setup and Gotchas

CORS on CloudFront looks simple until caching gets involved. That’s the part that bites people. You add Access-Control-Allow-Origin, test once, it works, then a different origin starts failing or getting the wrong response from cache. If you’ve ever had a “works in curl, fails in browser” day with CloudFront, this is usually why. I’m going to show the setups that actually work in production: static assets behind CloudFront APIs behind CloudFront S3 origins custom origins like ALB, EC2, or API backends dynamic origin allowlists preflight caching without poisoning your edge cache What CloudFront does in a CORS flow CloudFront is a cache and proxy sitting between the browser and your origin. ...

October 14, 2026 · 7 min · headertest.com

CORS Mistakes on Google Cloud Load Balancing

CORS on Google Cloud Load Balancing looks easy right up until the browser starts throwing No 'Access-Control-Allow-Origin' header and your backend logs show perfectly healthy 200 responses. That mismatch is the whole problem: your server can be fine, your load balancer can be fine, and the browser still blocks the response because the headers are wrong, missing, cached badly, or only added on the happy path. I’ve seen the same set of mistakes over and over on Google Cloud external HTTP(S) load balancers. Most of them come down to one thing: treating CORS like an app feature when it’s really a browser contract enforced at the edge. ...

October 12, 2026 · 7 min · headertest.com