-
Notifications
You must be signed in to change notification settings - Fork 2k
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
apollo-datasource-rest RESTDataSource does not handle HTTP 204 responses correctly #2606
Conversation
@dhm116: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
We ran into this issue with an API behind AWS API Gateway where we were returning a 204 status code with no Content-Type response header. API Gateway seems to be adding a |
I'll get the tests fixed up today! |
packages/apollo-datasource-rest/src/__tests__/RESTDataSource.test.ts
Outdated
Show resolved
Hide resolved
This is fixed in #2446 |
We noticed that the RESTDataSource.parseBody method was not handling HTTP 204 responses correctly in the event that a
Content-Type: application/json
header was being defined on the response.This PR resolves that issue by inspecting the
response.status
to ensure that it is not204
before attempting to process the response as JSON.TODO: