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 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 for Pulumi: copy-paste recipes for real stacks

CORS gets weird fast when you move from app code into infrastructure. In Pulumi, that usually means you’re not “fixing a header bug” — you’re wiring behavior across buckets, CDNs, API gateways, Lambda responses, and sometimes the browser cache too. I’ve seen teams burn hours changing app code when the real problem was an S3 bucket CORS rule, an API Gateway preflight route, or CloudFront stripping Origin from the cache key. ...

April 27, 2026 · 7 min · headertest.com