-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrap-nested-params for non-form content-types #235
Conversation
:form-params params})] | ||
(is (= 200 (:status resp))) | ||
(is (= "close" (get-in resp [:headers "connection"]))) | ||
(prn (:body resp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a leftover prn?
@r0man this causes a lot of test failures it look like: https://gist.github.com/dakrone/6b2fd64508b5fcd355ea |
@dakrone I'll take a look ... |
158f7de
to
161781c
Compare
@dakrone Sorry, for the failing tests. Not sure what I did |
(defn ^:dynamic parse-transit | ||
"Resolve and apply Transit's JSON/MessagePack parsing." | ||
[& args] | ||
(defn transit-decode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave this as ^:dynamic
and named parse-transit
? I am trying to stick with the convention of parse-edn
and parse-html
, as well as making it rebindable so people can implement their own transit parsing if desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the JSON fns and thought that's the convention. ;)
Anyway renamed this back to parse-transit and made it dynamic.
@r0man left a few comments |
161781c
to
c2ec726
Compare
The `wrap-nested-params` always kicked in, except when the :content-type was set to :json. When sending nested structures as :edn or :transit the payload got also nested. This PR fixes that problem, by only nesting if there is no content type set (which defaults to x-www-form-urlencoded) or if the content type is x-www-form-urlencoded.
c2ec726
to
4044f85
Compare
Merged, thanks! |
Cool. Thx! On Sat, Dec 13, 2014 at 8:31 PM, Lee Hinman notifications@github.com
|
The
wrap-nested-params
always kicked in, except when the :content-typewas set to :json. When sending nested structures as :edn or :transit the
payload got also nested. This PR fixes that problem, by only nesting if
there is no content type set (which defaults to x-www-form-urlencoded)
or if the content type is x-www-form-urlencoded.