Fork me on GitHub
#ring
<
2021-01-22
>
kwladyka20:01:06

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 .

kwladyka20:01:52

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.

kwladyka20:01:22

Otherwise it is magic ring bug

kwladyka20:01:16

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.

kwladyka20:01:07

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.

kwladyka20:01:45

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