Skip to content

Commit 9f47c77

Browse files
committed
system property for middleware
1 parent 0143230 commit 9f47c77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/compojure/api/core.clj

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
:deprecated "1.1.14"
5555
:superseded-by "route-middleware"}
5656
[middleware & body]
57+
(assert (= "true" (System/getProperty "compojure.api.core.allow-dangerous-middleware"))
58+
(str "compojure.api.core.middleware is deprecated because of security issues. "
59+
"Please use route-middleware instead. "
60+
"Set compojure.api.core.allow-dangerous-middleware=true to keep using middleware."))
5761
`(let [body# (routes ~@body)
5862
wrap-mw# (mw/compose-middleware ~middleware)]
5963
(routes/create nil nil {} [body#] (wrap-mw# body#))))

0 commit comments

Comments
 (0)