and then mentioned that a response template will be used to return the correct one in the Access-Control-Allow-Origin header. However, when I do this I simply get both values returned and the browser throws a fit.
Is the response template not automatically generated? Should I add it myself to serverless.yaml? Is there an example somewhere I can have a look at?
I ran into a similar problem using AWS API Gateway and enabling multiple origins. I found that even though the “Access-Control-Allow-Origin” header in Header Mappings inside the Integrated Response indicates that only one domain was applied, you have to scroll down to the Mapping Templates section and click on the application/json Content-Type to see that the logic contains all of the domains listed under origins in your yaml file.
Wow I didn’t know this is possible. so what to do if the mapping code is not there? Is there a way to set it up in the serverless.yaml so that it gets version controlled and automatically sat?