Skip to content

Commit

Permalink
system property for middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Apr 22, 2024
1 parent 0143230 commit 9f47c77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compojure/api/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
:deprecated "1.1.14"
:superseded-by "route-middleware"}
[middleware & body]
(assert (= "true" (System/getProperty "compojure.api.core.allow-dangerous-middleware"))
(str "compojure.api.core.middleware is deprecated because of security issues. "
"Please use route-middleware instead. "
"Set compojure.api.core.allow-dangerous-middleware=true to keep using middleware."))
`(let [body# (routes ~@body)
wrap-mw# (mw/compose-middleware ~middleware)]
(routes/create nil nil {} [body#] (wrap-mw# body#))))
Expand Down

0 comments on commit 9f47c77

Please sign in to comment.