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

Fix getting JSON response for 204 status code #53

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

mbie
Copy link
Collaborator

@mbie mbie commented Jun 4, 2024

If a JSON request returns valid 204 status code the request.json() function fails with:

Unexpected end of JSON input

This is a known issue whatwg/fetch#113

One of the suggested solutions is to check the status code and just return empty string object, which seems a good option for that issue.

@mbie mbie self-assigned this Jun 4, 2024
packages/slack/src/request.ts Outdated Show resolved Hide resolved
@mbie mbie merged commit f7fd387 into master Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants