📎 Update default scripts

This commit is contained in:
Andrey Antukh 2022-04-01 13:23:06 +02:00 committed by Andrés Moya
parent c5b1b67c50
commit 602b736163
5 changed files with 17 additions and 10 deletions

View file

@ -99,7 +99,10 @@
(let [body (yrs/body response)]
(if (coll? body)
(let [qs (yrq/query request)
opts {:type (if (str/includes? qs "verbose") :json-verbose :json)}]
opts (if (or (contains? cf/flags :transit-readable-response)
(str/includes? qs "transit_verbose"))
{:type :json-verbose}
{:type :json})]
(-> response
(update :headers assoc "content-type" "application/transit+json")
(assoc :body (transit-streamable-body body opts))))

View file

@ -166,11 +166,9 @@
(a/go
;; Only allow receive pointer updates when active subscription
(when-let [{:keys [topic]} (get-in @wsp [::subscriptions subs-id])]
(l/trace :fn "handle-message" :event :pointer-update :message message)
(let [msgbus-fn (:msgbus @wsp)
profile-id (::profile-id @wsp)
session-id (::session-id @wsp)
message (-> message
(dissoc :subs-id)
(assoc :profile-id profile-id)