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

Stream all transit responses.

Instead of buffering for etag. The etags are temporary disabled.
This commit is contained in:
Andrey Antukh 2021-07-26 13:43:39 +02:00
parent 6ee6a03e4a
commit 07eeb76a5f
2 changed files with 12 additions and 5 deletions

View file

@ -136,7 +136,9 @@
["/webhooks"
["/sns" {:post (:sns-webhook cfg)}]]
["/api" {:middleware [[middleware/etag]
["/api" {:middleware [
;; Temporary disabled
#_[middleware/etag]
[middleware/format-response-body]
[middleware/params]
[middleware/multipart-params]

View file

@ -92,10 +92,15 @@
(coll? body)
(-> response
(update :headers assoc "content-type" "application/transit+json")
(assoc :body
(if (= :post (:request-method request))
(transit-streamable-body body opts)
(t/encode body opts))))
(assoc :body (transit-streamable-body body opts)))
;; ;; Temporary disabled
;; (-> response
;; (update :headers assoc "content-type" "application/transit+json")
;; (assoc :body
;; (if (= :post (:request-method request))
;; (transit-streamable-body body opts)
;; (t/encode body opts))))
(nil? body)
(assoc response :status 204 :body "")