You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2018. It is now read-only.
Call a service method which returns a 204 status with no body while using the fetch connection - response.json() then fails to parse the body and throws and error.
@daffl yeah I tried internally, and just adding an if (response.status === 204) at that line you've linked to does the trick. I'll make a PR with tests.
Unfortunately fetchknows and its considered expected behavior, though I get that how low level it is they didn't want to treat it any different just because it was JSON.
Steps to reproduce
Call a service method which returns a
204
status with no body while using thefetch
connection -response.json()
then fails to parse the body and throws and error.https://jsbin.com/wacosaneqo/edit?html,console
Expected behavior
It should return a
null
response and throw no errorActual behavior
Throws
Error: Unexpected end of JSON input
System configuration
Operating System:
macOS Sierra
Browser Version:
Chrome 54
The text was updated successfully, but these errors were encountered: