You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the CORS origins functionality, the mapping template created for the API-Gateway integration response mapping templates contain square brackets being placed around all . in the urls. This then results in the origins that are defined as they are not equivalent, i.e. "https://www.example.com" !== "https://www[.]example[.]com").
The issue is present in version 1.52.2 of serverless. I found using an older version specifically 1.41.1 resolves the issue such that the mapping templates work as expected.
It seems that the change that add in the logic is #6043. Specfically it adds this function
Bug Report
Description
When using the CORS origins functionality, the mapping template created for the API-Gateway integration response mapping templates contain square brackets being placed around all
.
in the urls. This then results in the origins that are defined as they are not equivalent, i.e."https://www.example.com" !== "https://www[.]example[.]com")
.The issue is present in version
1.52.2
of serverless. I found using an older version specifically1.41.1
resolves the issue such that the mapping templates work as expected.It seems that the change that add in the logic is #6043. Specfically it adds this function
which looks to hanlde support for wildcards in origins.
In my
serverless.yml
I have the following CORS setup:Deployed a lambda function with a API-Gateway endpoint. When trying to call the endpoint using one of the defined origins, I get a CORS error,
Once deployed the API Gateway integration response mapping template becomes:
There are unexpected square brackets in the URL, which when calling the API Gateway endpoints from the origins declared in the
I was expecting the mapping template to be:
serverless.yml
file?Serverless Framework Config File
SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)No
Similar or dependent issues:
The text was updated successfully, but these errors were encountered: