Change order in which middleware is applied by Scope

This commit is contained in:
Rashad Gover 2023-10-15 14:38:05 -07:00
parent 25d9ff448f
commit 90225e6330

View File

@ -192,7 +192,7 @@ middleware' middlewareToApply (appsHead : appsTail) backup req resp =
if prefix `List.isPrefixOf` Wai.pathInfo req if prefix `List.isPrefixOf` Wai.pathInfo req
then do then do
let newReq = req {Wai.pathInfo = drop (length prefix) (Wai.pathInfo req)} let newReq = req {Wai.pathInfo = drop (length prefix) (Wai.pathInfo req)}
middleware' (middlewareToApply . otherMiddlewareToApply) apps backup newReq resp middleware' (otherMiddlewareToApply . middlewareToApply) apps backup newReq resp
else middleware' middlewareToApply appsTail backup req resp else middleware' middlewareToApply appsTail backup req resp
tree :: App -> IO (Tree.Tree String) tree :: App -> IO (Tree.Tree String)