mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 20:06:38 +02:00
🐛 Fix bug on body decoding (backend).
This commit is contained in:
parent
ba618eb51d
commit
1af87b9140
1 changed files with 3 additions and 2 deletions
|
@ -21,9 +21,10 @@
|
||||||
|
|
||||||
(defn- wrap-parse-request-body
|
(defn- wrap-parse-request-body
|
||||||
[handler]
|
[handler]
|
||||||
(fn [{:keys [headers body] :as request}]
|
(fn [{:keys [headers body method] :as request}]
|
||||||
(let [mtype (get headers "content-type")]
|
(let [mtype (get headers "content-type")]
|
||||||
(if (= "application/transit+json" mtype)
|
(if (and (= "application/transit+json" mtype)
|
||||||
|
(not= method :get))
|
||||||
(try
|
(try
|
||||||
(let [params (t/decode (t/buffer->bytes body))]
|
(let [params (t/decode (t/buffer->bytes body))]
|
||||||
(handler (assoc request :body-params params)))
|
(handler (assoc request :body-params params)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue