Hi guys, quick question. Is there any with ring/compojure to read the raw body of a request that is application/x-www-form-urlencoded
No matter what I do, even when I remove all middleware it's always a map
I need the raw request to do a an hmac digest on it to verify the request
I thought about using (ring.util.codec/url-encode payload)
but obviously these maps aren't ordered
@mdrago1026 I'm pretty sure the answer is "no" because by the time Ring has passed you the request, it has already been read and decoded -- and not all servers allow the raw body of a request to be read twice, as I recall...
Yeah, i believe you are right, which is unfortunate. Still digging in to it. It's weird, even if I intercept the BytesInputStream
and slurp it, it already seems to be a map
For what it's worth, I found a workaround. I'm using http-kit. Before I hand the request off to any of my compojure handlers, I'm consuming the :body of the request. At this point it is still in the "raw" form. I just assoc it to the request as a different key, then pass on to the handlers. Not pretty, but it works