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

Decoding a falsy http response body causes error #134

Closed
lotuc opened this issue Jul 30, 2023 · 1 comment · Fixed by #136
Closed

Decoding a falsy http response body causes error #134

lotuc opened this issue Jul 30, 2023 · 1 comment · Fixed by #136

Comments

@lotuc
Copy link
Contributor

lotuc commented Jul 30, 2023

muuntaja.core/decode-response-body will throw error on falsy values:

(require '[muuntaja.core :as m])

(m/decode-response-body
 {:body "null" :headers {"Content-Type" "application/json"}})
(m/decode-response-body
 {:body "false" :headers {"Content-Type" "application/json"}})
(m/decode-response-body
 {:body "false" :headers {"Content-Type" "application/edn"}})

It's caused by the code here.

@ikitommi
Copy link
Member

Oh, that's not good. PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants