hummingbird-project / hummingbird-examples

Examples demonstrating various aspects of the Hummingbird swift server framework
Apache License 2.0
90 stars 19 forks source link

Add comment about CORS in todos-lambda #130

Closed natanrolnik closed 1 month ago

natanrolnik commented 1 month ago

While testing something with a lambda, I noticed I had twice the Access-Control-Allow-Origin header, and it led to CORS errors when calling my lambda function from the browser.

Upon investigation, I found that it was due to CORS being set both at the code level, and at the Lambda function URL configuration level. When it's configured in the Lambda URL, there's no need to setup CORSMiddleware.

This PR adds a comment about it in the todos-lambda sample project.