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

WKWebView CORS Mistakes on iOS and How to Fix Them

CORS inside WKWebView trips up a lot of teams because it feels like “Safari in my app,” until it very much doesn’t. I’ve seen the same pattern over and over: the API works in desktop Chrome, maybe even in Safari, but the iOS app throws a vague CORS error, cookies disappear, preflights fail, or local bundled content can’t talk to the backend. Then someone suggests turning off security. Don’t. Here are the common mistakes I see with CORS in WKWebView, why they happen, and the clean fixes. ...

November 20, 2026 · 7 min · headertest.com

Fixing CORS in AWS CDK Without Guesswork

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

November 19, 2026 · 7 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

Shopware API CORS Mistakes and How to Fix Them

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

November 4, 2026 · 7 min · headertest.com

CORS and Safari Quirks: ITP Mistakes and Fixes

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

November 2, 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