ring

kwladyka 2021-01-22T20:16:06.001600Z

I have to debug ring request. body-string as a first wrapper read nil from body. It works after wrap-restful-format but then it is too late. I want to see original string sent by client. How can I do it? While it looks easy it is not 🙂 To be specific I debug JSON request, so something like this curl -H "Content-Type: application/json" -d @foo.json -i <https://foo>.

kwladyka 2021-01-22T20:17:52.002500Z

I expect client send numbers in wrong format, but I can’t prove it, because it looks ring correct them, but in some magic way not everywhere.

kwladyka 2021-01-22T20:18:22.002900Z

Otherwise it is magic ring bug

kwladyka 2021-01-22T20:22:16.004300Z

The issue is about (wrap-json-body {:keywords? true :bigdecimals? true}) which have correct values 0.1M, but in only one client has 0.10000000000000001M. params and body-params are qual. Only body has a difference. It is weird.

kwladyka 2021-01-22T20:43:07.006Z

So it looks like wrap-restful-format doesn’t work with string as a :body. So reading body before this wrapper is an issue. I am curious why it is working like that.

kwladyka 2021-01-22T20:46:45.006500Z

another fact is slurp can read body while ring.util.request/body-string can’t