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

Handle no content #95

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Handle no content #95

merged 3 commits into from
Sep 16, 2021

Conversation

chawes13
Copy link
Contributor

@chawes13 chawes13 commented Sep 4, 2021

Resolves #90

This is not a breaking change because the current behavior is to return null and log a warning message. This change simply short circuits the function before .json() is invoked and only returns null.

This isn't handled natively by the Response object and follows the approach recommended here: whatwg/fetch#113 (comment).

Copy link

@bhennes2 bhennes2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well!

Copy link

@mwislek mwislek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done!

@chawes13 chawes13 merged commit b54340d into master Sep 16, 2021
@chawes13 chawes13 deleted the feature/handle-no-content branch September 16, 2021 13:42
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.

204 Response Should Not Expect Body
3 participants