mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 17:01:11 +00:00
Tighten middleware spec from collection to vector
This avoids messing up the order of middleware chain accidentally.
This commit is contained in:
parent
4a199b918a
commit
69795f5fe7
2 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
;; Specs
|
;; Specs
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(s/def ::middleware (s/coll-of #(satisfies? middleware/IntoMiddleware %)))
|
(s/def ::middleware (s/coll-of #(satisfies? middleware/IntoMiddleware %) :kind vector?))
|
||||||
(s/def ::get map?)
|
(s/def ::get map?)
|
||||||
(s/def ::head map?)
|
(s/def ::head map?)
|
||||||
(s/def ::post map?)
|
(s/def ::post map?)
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
(testing "middleware cannot be a list"
|
(testing "middleware cannot be a list"
|
||||||
(is (thrown-with-msg?
|
(is (thrown-with-msg?
|
||||||
ExceptionInfo
|
ExceptionInfo
|
||||||
#":reitit.ring.spec/invalid-specs"
|
#"Invalid route data"
|
||||||
(ring/router
|
(ring/router
|
||||||
["/api" {:handler identity
|
["/api" {:handler identity
|
||||||
:middleware '()}]
|
:middleware '()}]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue