ring

st3fan 2020-11-16T17:49:01.010Z

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

mpenet 2020-11-16T17:53:39.011300Z

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

st3fan 2020-11-16T17:59:51.012500Z

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

st3fan 2020-11-16T18:00:11.013Z

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

ska 2020-11-18T15:15:26.015300Z

you can return a stream on the byte-buffer

mpenet 2020-11-16T18:02:02.014900Z

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

st3fan 2020-11-16T18:12:46.015200Z

specially if it is the last in a chain of middleware