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

[apollo-datasource-rest] Error thrown when parsing 204 response #2434

Closed
EspadaV8 opened this issue Mar 12, 2019 · 2 comments
Closed

[apollo-datasource-rest] Error thrown when parsing 204 response #2434

EspadaV8 opened this issue Mar 12, 2019 · 2 comments

Comments

@EspadaV8
Copy link

We have a number of endpoints that return the 204 HTTP status code when handling DELETE requests. These are currently throwing an error because of the attempt to parse the body (

return (this.parseBody(response) as any) as Promise<TResult>;
), however, for these responses there isn't a body. To handle this I think that didReceiveResponse should check the status code before attempting to parse the body.

@EspadaV8
Copy link
Author

(more than happy to open a small PR to handle this if you're okay with it the suggestion, wanted to get feedback beforehand)

@abernix
Copy link
Member

abernix commented Jul 16, 2019

Fixed via #2446! Thanks for reporting this originally.

@abernix abernix closed this as completed Jul 16, 2019
@abernix abernix removed 🚧👷‍♀️👷‍♂️🚧 in triage Issue currently being triaged labels Jul 16, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants