From d5dccfa94ab5ccb4cf28ef85e38132b5ea5c7957 Mon Sep 17 00:00:00 2001 From: Gustavo Valente Date: Mon, 18 Dec 2023 17:19:37 -0300 Subject: [PATCH] Fix routes-interceptor to wrap route/match fn Co-authored-by: Iain Wood --- src/xiana/handler.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xiana/handler.clj b/src/xiana/handler.clj index a027d800..176685c2 100644 --- a/src/xiana/handler.clj +++ b/src/xiana/handler.clj @@ -25,8 +25,11 @@ ([http-request] (let [websocket? (jetty/ws-upgrade-request? http-request) state (state/make deps http-request) - queue (list #(interceptor.queue/execute % (:router-interceptors deps)) + enter-routes (map #(select-keys % [:enter :name]) (:router-interceptors deps)) + leave-routes (map #(select-keys % [:leave :name]) (:router-interceptors deps)) + queue (list #(interceptor.queue/execute % enter-routes) #(route/match %) + #(interceptor.queue/execute % leave-routes) #(interceptor.queue/execute % (if websocket? (:web-socket-interceptors deps) (:controller-interceptors deps))))