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

Ignore body when 204 response status received #332

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Ignore body when 204 response status received #332

merged 1 commit into from
Feb 7, 2023

Conversation

freaz
Copy link
Member

@freaz freaz commented Feb 6, 2023

Description

Skip body handling for 204 responses

Motivation and Context

Some server may return Content-Type: application/json header, but don't send any body.
This leads to failed JSON.parse.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have updated the documentation accordingly. If you are changing code related to user secrets you need to really make sure that security documentation is correct.
  • I have read the CONTRIBUTING document.
  • I haven't repeated the code. (DRY)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@freaz freaz changed the title Ignore body on 204 response status Ignore body when 204 response status received Feb 6, 2023
@freaz freaz merged commit 74547a8 into dev Feb 7, 2023
@freaz freaz deleted the fix/no_body branch February 7, 2023 14:04
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