-
-
Notifications
You must be signed in to change notification settings - Fork 916
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
Undocumented breaking change #978
Comments
An empty string is still valid JSON. |
From the reply I think I was not clear or the report was not read carefully. My expectation is that no error is thrown when the response body is empty. |
@szmarczak can you please reopen or clarify? |
In the sense that now you try to If the change is intended I'm fine with it but it should be documented and no, this
is not enough because the change affects all responses not only 204. |
This is fixed in 071bf5e I'll also write a test for it. |
This is tested here: d709fd7 |
Sorry for misunderstanding the issue. Indeed, this was a regression. |
What would you like to discuss?
There seems to be an undocumented breaking change in
got@10
when the response body is empty and theresponseType
option is set to'json'
.The promise is rejected with a
got.ParseError
.In
got@9.6.0
the same code with thejson
option set totrue
, returns a promise which is resolved andresponse.body
is set to an empty string.Is the breaking change intentional?
Checklist
The text was updated successfully, but these errors were encountered: