Skip to content

Commit

Permalink
0.9.0 adds JSON body decoding (to params)
Browse files Browse the repository at this point in the history
Adds ring/ring-json middleware.
  • Loading branch information
seancorfield committed Nov 9, 2016
1 parent 556d063 commit 31efcd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.boot
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
; core web request handling
[ring "1.6.0-beta6"]
[ring/ring-defaults "0.2.1"]
[ring/ring-json "0.5.0-beta1"]
; view/layout templates
[selmer "1.0.9"]
; standardized application start/stop
Expand Down
2 changes: 1 addition & 1 deletion resources/fw1.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.6
0.9.0
9 changes: 6 additions & 3 deletions src/framework/one.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
[compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :as ring-md]
[ring.middleware.json :as ring-json]
[selmer.filters]
[selmer.parser]
[selmer.util :refer [resource-path]]))
Expand Down Expand Up @@ -453,10 +454,12 @@
and the fn passed in may modify those defaults."
[modifier-fn]
(fn [handler]
(ring-md/wrap-defaults handler (-> ring-md/site-defaults
(-> handler
(ring-md/wrap-defaults (-> ring-md/site-defaults
; you have to explicitly opt in to this:
(assoc-in [:security :anti-forgery] false)
modifier-fn))))
(assoc-in [:security :anti-forgery] false)
modifier-fn))
(ring-json/wrap-json-params))))

(def ^:private default-options-access-control
{:origin "*"
Expand Down

0 comments on commit 31efcd0

Please sign in to comment.