Closed pareis closed 10 months ago
Thanks! What would you hope to get from a CORS middleware compared to the built-in CORS functionality in HTTP APIs? https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html
Not saying that there isn't a use case, just trying to better understand the situation.
Closed as there was no response
At the moment,
cors
middleware seems to not support a version 2.0 payload of the HTTP API for AWS Lambda. There, the HTTP method is available underevent.requestContext.http.method
notevent.httpMethod
.Here's the existing code:
Would you be willing to help with a PR?
Describe the solution you'd like
The handler should be able to dynamically understand an HTTP API payload.
Describe alternatives you've considered
I have removed the dedicated middleware config for the APIs in question and have instead set
cors
totrue
at the API Gateway level. This works in my case but will not allow fine grained control that might be needed for sophisticated cases.Additional context
None