mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 00:41:12 +00:00
Fix #394
This commit is contained in:
parent
79c430d298
commit
b8b442b598
3 changed files with 20 additions and 7 deletions
|
|
@ -28,6 +28,10 @@ is called the first time, so that `rfe/push-state` and such can be called
|
|||
[metosin/malli "0.0.1-20200404.091302-14"] is available but we use "0.0.1-20200305.102752-13"
|
||||
```
|
||||
|
||||
### `reitit-ring`
|
||||
|
||||
* `reitit.ring/routes` strips away `nil` routes, fixes [#394](https://github.com/metosin/reitit/issues/394)
|
||||
|
||||
## 0.4.2 (2020-01-17)
|
||||
|
||||
### `reitit`
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
(defn routes
|
||||
"Create a ring handler by combining several handlers into one."
|
||||
[& handlers]
|
||||
(let [single-arity (apply some-fn handlers)]
|
||||
(let [single-arity (apply some-fn (keep identity handlers))]
|
||||
(fn
|
||||
([request]
|
||||
(single-arity request))
|
||||
|
|
|
|||
|
|
@ -24,6 +24,15 @@
|
|||
([request respond _]
|
||||
(respond (handler request))))
|
||||
|
||||
(deftest routes-test
|
||||
(testing "nils are removed"
|
||||
(is (= 123
|
||||
((ring/routes
|
||||
(constantly nil)
|
||||
nil
|
||||
(constantly 123))
|
||||
::irrelevant)))))
|
||||
|
||||
(deftest ring-router-test
|
||||
|
||||
(testing "all paths should have a handler"
|
||||
|
|
|
|||
Loading…
Reference in a new issue