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