Don't push :path-params if there aren't any

This commit is contained in:
Tommi Reiman 2017-09-08 08:28:15 +03:00
parent d60c67c0c3
commit ac8a7b5cd2

View file

@ -28,7 +28,7 @@
(if handler
(handler
(cond-> (impl/fast-assoc request ::match match)
params (impl/fast-assoc :path-params params)))))))
(seq params) (impl/fast-assoc :path-params params)))))))
([request respond raise]
(if-let [match (reitit/match-by-path router (:uri request))]
(let [method (:request-method request :any)
@ -39,7 +39,7 @@
(if handler
(handler
(cond-> (impl/fast-assoc request ::match match)
params (impl/fast-assoc :path-params params))
(seq params) (impl/fast-assoc :path-params params))
respond raise))))))
{::router router}))