We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46384c7 commit d093486Copy full SHA for d093486
2 files changed
src/compojure/core.clj
@@ -111,7 +111,7 @@
111
(if (vector? bindings)
112
`(let [~@(vector-bindings bindings request)]
113
~(if-let [syms (application-symbols bindings)]
114
- `(if (and ~@syms) (do ~@body))
+ `(if (and ~@(for [s syms] `(not (nil? ~s)))) (do ~@body))
115
`(do ~@body)))
116
`(let [~bindings ~request] ~@body)))
117
test/compojure/core_test.clj
@@ -56,6 +56,8 @@
56
(mock/request :get "/foo/bar")))))
57
(is (not (nil? ((GET "/foo/:x" [x :<< coercions/as-int] (str x))
58
(mock/request :get "/foo/100")))))
59
+ (is (not (nil? ((GET "/foo/:x" [x :<< #(Boolean/valueOf %)] (str x))
60
+ (mock/request :get "/foo/false")))))
61
(is (nil? ((GET "/foo/:x" [x :<< coercions/as-int] (str x))
62
63
0 commit comments