0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

🐛 Fix bug on body decoding (backend).

This commit is contained in:
Andrey Antukh 2020-05-11 08:03:02 +02:00 committed by Alonso Torres
parent ba618eb51d
commit 1af87b9140

View file

@ -21,9 +21,10 @@
(defn- wrap-parse-request-body
[handler]
(fn [{:keys [headers body] :as request}]
(fn [{:keys [headers body method] :as request}]
(let [mtype (get headers "content-type")]
(if (= "application/transit+json" mtype)
(if (and (= "application/transit+json" mtype)
(not= method :get))
(try
(let [params (t/decode (t/buffer->bytes body))]
(handler (assoc request :body-params params)))