Skip to content

Throws error on :accept :json when response body is empty. #24

Open
@knubie

Description

@knubie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions