Closed bobotu closed 7 years ago
Can you add -request
and -response
functions where it makes sense to do so, like the rest of the Ring async code? For example:
(defn json-body-request
"Parse a JSON request body and assoc it back into the :body key. Returns nil
if the JSON is malformed. See: wrap-json-body."
[request options]
(if-let [[valid? json] (read-json request options)]
(if valid? (assoc request :body json))
request))
@weavejester I have modified the code, is this okay?
I've added some comments to your code. I think there are a couple of lines that have an error/typo, and the functions you've doc-stringed should be public now :)
@weavejester Thanks for your patient. I have fixed those mistakes just now.
Add CPS support to json-middleware