When you specify an :accept :json header, lambdaisland/fetch will attempt to automatically decode the response body using response.json(). However this will fail and raise an error if the response body is empty (ie JSON.parse('')).
|
(defmethod decode-body :json [_ response opts] |
|
(j/call response :json)) |
The code should probably check if the body is empty first.
When you specify an
:accept :jsonheader,lambdaisland/fetchwill attempt to automatically decode the response body usingresponse.json(). However this will fail and raise an error if the response body is empty (ieJSON.parse('')).fetch/src/lambdaisland/fetch.cljs
Lines 66 to 67 in 246d561
The code should probably check if the body is empty first.