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

CORS fixes for 1.1.0+ #5429

Merged
merged 11 commits into from
May 4, 2022
Merged

CORS fixes for 1.1.0+ #5429

merged 11 commits into from
May 4, 2022

Conversation

dac09
Copy link
Contributor

@dac09 dac09 commented May 4, 2022

What does this PR do?

  • Downgrades cross-undici-fetch, because there's a bug in the new Request constructor
  • Upgrades graphql-yoga to latest with fixes for CORs
  • Refactors the CORS logic so that its more testable
  • Adds a whole bunch of tests on this. The tests will pass once yoga is updated again to accespt false as CorsOptions to disable all CORS headers

Closes #4853
Closes #5344

@netlify
Copy link

netlify bot commented May 4, 2022

Deploy Preview for redwoodjs-docs canceled.

Name Link
🔨 Latest commit d02b427
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/6272a23f2b72c000089d478e

@dac09 dac09 force-pushed the chore/CORS-chcecks-gql branch from 29226b5 to 996dabb Compare May 4, 2022 10:05
@dac09 dac09 added the release:fix This PR is a fix label May 4, 2022
@dac09 dac09 requested a review from jtoar May 4, 2022 12:43
@dac09 dac09 marked this pull request as ready for review May 4, 2022 12:57
@jtoar jtoar merged commit 5bc862e into redwoodjs:main May 4, 2022
@jtoar jtoar added this to the next-release milestone May 4, 2022
@dac09 dac09 deleted the chore/CORS-chcecks-gql branch May 4, 2022 18:09
jtoar pushed a commit that referenced this pull request May 5, 2022
* Make cors mapping testable

* Just supply the cors object instead of doing a builder

* Add origins in config too

* Fix import

* Start adding tests for createGraphqlHandler

* Try with latest canary build

* Cleanup mocked lambda event

* Downgrade undici fetch | Set yoga cors to false if no redwood cors options supplied (still to be implemented in yoga)

* Downgrade cross-undici-fetch everywhere

* Bump yoga to 2.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1.1.0 & 1.2.0 Cors Error Add unit test for testing CORS options in createGraphqlHandlerFunction
2 participants