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

Add allowMethods options to @middy/http-cors #627

Closed
wants to merge 4 commits into from

Conversation

camiloaz
Copy link

What does this implement/fix? Explain your changes.

This PR adds the option to set an allowMethods option that allows setting the Access-Control-Allow-Methods header in the preflight CORS requests.

Does this close any currently open issues?

There is an already closed issue #43 that asks for this. But it was never really solved.

Where has this been tested?

Node.js Versions: 12.18.3

Middy Versions: 1.5.2

AWS SDK Versions:

Todo list

[x] Feature/Fix fully implemented
[x] Added tests
[x] Updated relevant documentation
[x] Updated relevant examples

@camiloaz
Copy link
Author

camiloaz commented Mar 19, 2021

BTW, I noticed that on npm install all the package-lock.json files changed. The root package-lock.json changes only on this line:
Screen Shot 2021-03-19 at 1 00 13 PM

And then all the packages include changes like this:
Screen Shot 2021-03-19 at 1 02 21 PM

I wonder whether i should commit that or what's wrong there?

@willfarrell
Copy link
Member

@camiloaz thanks for the PR. We're no longer accepting changes to v1.

Access-Control-Allow-Methods has been added to v2 which is set to have a stable release soon.

https://github.com/middyjs/middy/blob/release/2.x/packages/http-cors/index.js#L54

Please let us know if this implementation meets your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants