aws / aws-lambda-runtime-interface-emulator

Apache License 2.0
915 stars 95 forks source link

CORS support. Allow OPTIONS request. Support requests from @aws-sdk/client-lambda #84

Open djsamseng opened 1 year ago

djsamseng commented 1 year ago

Fixes https://github.com/aws/aws-lambda-runtime-interface-emulator/issues/16

Sets response headers allowing requests from browsers that send preflight OPTIONS requests. Previously using @aws-sdk/client-lambda returned CORS errors. Now requests and responses can be sent.

Test Plan: Build and run locally. Ensure curl -XPOST still works. Ensure requests from browsers now work and from @aws-sdk/client-lambda Test steps added to Contributing.md. Ensure make integ-tests-and-compile passes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

major-mayer commented 1 year ago

Can somebody please merge this? Maybe @valerena It would make the testing of custom Lambda functions with container images much simpler.