mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
pass-through function interceptors
This commit is contained in:
parent
92638dbb20
commit
fd8985fd75
2 changed files with 6 additions and 1 deletions
|
|
@ -60,6 +60,7 @@
|
|||
(into-interceptor [this data opts]
|
||||
(into-interceptor
|
||||
{:name ::handler
|
||||
::handler this
|
||||
:enter (fn [ctx]
|
||||
(assoc ctx :response (this (:request ctx))))}
|
||||
data opts))
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@
|
|||
(reify
|
||||
interceptor/Executor
|
||||
(queue [_ interceptors]
|
||||
(queue/into-queue interceptors))
|
||||
(queue/into-queue
|
||||
(map
|
||||
(fn [{:keys [::interceptor/handler] :as interceptor}]
|
||||
(or handler interceptor))
|
||||
interceptors)))
|
||||
(execute [_ interceptors request]
|
||||
(sieppari/execute interceptors request))
|
||||
(execute [_ interceptors request respond raise]
|
||||
|
|
|
|||
Loading…
Reference in a new issue