Hi, how can I ask muuntaja to kindly leave my response completely untouched? Following the wiki, I configured
(def no-response-coercion
(schema-coercion/create-coercion
(assoc schema-coercion/default-options :response nil)))
as coercion, but it's still failing to serialize e.g. a ByteArrayInputStream
provided as a response body it, so I assume I'm doing something wrong@mrchance by setting a Content-Type
header for example, "already formatted, don't touch" kinda hint
there is an option in Muuntaja config to set the predicate to encode the response. Hope this helps
Thanks, it helps a little, but the content will be a stream containing json data, so I don't really want to set a different one. I don't really understand why the above isn't working either
you don't have to set a different one, just having aany content-type will make Muuntaja skip encode
Oh, ok, thanks
I rechecked the code, we do set a content type header...
#(assoc
(ok %)
:headers {"content-type" "application/json"})
Oh, if I change the case of that, it seems to work? 😱
Yeah, "Content-Type" works as expected
Thanks!
np. Ring defines that incoming headers are lower-cased, responses are sent as-is. Hitting that often...
ooohkay, I'm sure there's a good reason for that 😉
#error {
:cause "No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)"
....}