mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Apply router options to top-level middleware chain
Middleware supplied to the `ring-handler` function could not be resolved from the middleware registry, because the router options (which contain the registry) were not being propagated. Fixes #738
This commit is contained in:
parent
7a77c9f86b
commit
0454e8914f
1 changed files with 1 additions and 1 deletions
|
|
@ -370,7 +370,7 @@
|
|||
([router default-handler {:keys [middleware inject-match? inject-router?]
|
||||
:or {inject-match? true, inject-router? true}}]
|
||||
(let [default-handler (or default-handler (fn ([_]) ([_ respond _] (respond nil))))
|
||||
wrap (if middleware (partial middleware/chain middleware) identity)
|
||||
wrap (if middleware #(middleware/chain middleware % nil (r/options router)) identity)
|
||||
enrich-request (create-enrich-request inject-match? inject-router?)
|
||||
enrich-default-request (create-enrich-default-request inject-router?)]
|
||||
(with-meta
|
||||
|
|
|
|||
Loading…
Reference in a new issue