Fork me on GitHub
#ring
<
2020-11-16
>
st3fan17:11:01

Is there a formal definition of what :body should be? Should it be a Reader or a String?

mpenet17:11:39

Depends if request/response. There is a spec file in the ring repo that formalizes this

st3fan17:11:51

Hmm InputStream .. I have a middleware that turns the body into a map - maybe that is not correct from a spec perspective

st3fan18:11:11

i guess body is tricky anyway because once you consume the InputStream, you can’t re-read it again

ska15:11:26

you can return a stream on the byte-buffer

mpenet18:11:02

Depends if you control whatever consumes it. For instance turning an inputstream representing json data to a map is ok depending on the context

st3fan18:11:46

specially if it is the last in a chain of middleware