Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is it possible to configure CORS? #16

Open
WalternativE opened this issue Dec 20, 2020 · 1 comment · May be fixed by #84
Open

Question: Is it possible to configure CORS? #16

WalternativE opened this issue Dec 20, 2020 · 1 comment · May be fixed by #84
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@WalternativE
Copy link

Hi, y'all! First of all thanks for your great work. My first time using AWS Lambda tooling and I'm really enjoying the experience so far 😊

My question because I didn't really find anything in the docs (which makes sense as the product is rather new): is it possible to configure CORS for the local RIE docker container which holds my custom function? Once it is deployed I'd imagine you would configure this directly in AWS but until then I currently don't see a way how I'd tell it to set CORS headers.

It's not the biggest of problems, as I could just use another pass-through CORS proxy locally. I was just wondering whether this was already a supported scenario.

Thanks a lot in advance!

@ghost ghost added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 17, 2022
djsamseng added a commit to djsamseng/aws-lambda-runtime-interface-emulator that referenced this issue Jan 13, 2023
…lient-lambda

Fixes aws#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
@w3ichen
Copy link

w3ichen commented Jul 27, 2023

Still not resolved in 2023! 😭
This pull request did fix it for me: #84.

So I cloned the v1.13 release, make the changes from the PR, and re-made the binaries. So that I could simply add this line to my Dockerfile and it would work for my AWS lambda image.

RUN curl -Lo /usr/local/bin/aws-lambda-rie https://github.com/MecSimCalc/aws-lambda-runtime-interface-emulator/raw/msc-v1.13/bin/aws-lambda-rie && chmod +x /usr/local/bin/aws-lambda-rie

It's not ideal, but better than nothing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
2 participants