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

Updated Google Cloud Function request handler to handle null or undefined req.path #1674

Merged
merged 6 commits into from Sep 18, 2018

Conversation

reaktivo
Copy link
Contributor

@reaktivo reaktivo commented Sep 16, 2018

The current implementation of the apollo-server-cloud-functions exported handler doesn't handle bare endpoints, that means for example, requesting https://us-central1-apollo-gcf-test.cloudfunctions.net/handler will return a 404, but accessing https://us-central1-apollo-gcf-test.cloudfunctions.net/handler/ (notice the added slash) will.

This is due to the way GCF sets request params, in which the in the first case req.path will be set to null, and in the second it will be set to "/"

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@ghost ghost added the ⛲️ feature New addition or enhancement to existing solutions label Sep 16, 2018
@reaktivo reaktivo changed the title Updated request handler to handle null or undefined req.path Updated Google Cloud Function request handler to handle null or undefined req.path Sep 16, 2018
@ghost ghost added the ⛲️ feature New addition or enhancement to existing solutions label Sep 16, 2018
@evans evans merged commit e949ab6 into apollographql:master Sep 18, 2018
@evans
Copy link
Contributor

evans commented Sep 18, 2018

@reaktivo Thank you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⛲️ feature New addition or enhancement to existing solutions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants