Skip to content

Commit

Permalink
confs
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Apr 22, 2024
1 parent 1c8547a commit e740c7b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/compojure/api/meta.clj
Original file line number Diff line number Diff line change
Expand Up @@ -948,15 +948,22 @@
bindings?))
"A context cannot be :static and also provide bindings. Either push bindings into endpoints or remove :static.")

configured-dynamic? (-> info :public :dynamic)
configured-dynamic? (or (-> info :public :dynamic)
(true? (get-in (meta *ns*) [:metosin/compojure-api :dynamic-contexts]))
(contains?
(some-> (System/getProperty "compojure.api.meta.dynamic-context-namespaces")
edn/read-string
set)
(ns-name *ns*)))

configured-static? (or (-> info :public :static)
(when-not configured-dynamic?
(contains?
(some-> (System/getProperty "compojure.api.meta.static-context-namespaces")
edn/read-string
set)
(ns-name *ns*))))
(or (true? (get-in (meta *ns*) [:metosin/compojure-api :static-contexts]))
(contains?
(some-> (System/getProperty "compojure.api.meta.static-context-namespaces")
edn/read-string
set)
(ns-name *ns*)))))

static? (or configured-static?
(and (not configured-dynamic?)
Expand Down

0 comments on commit e740c7b

Please sign in to comment.