Skip to content
Snippets Groups Projects
Commit 134649cd authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #167 from metabase/tweak_http_client

Tweak http client
parents 69034bb8 c08d8533
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,8 @@
(defn- remove-fns-and-delays
"Remove values that are fns or delays from map M."
[m]
(filter-vals #(and (not (fn? %))
(not (delay? %)))
(filter-vals #(not (or (delay? %)
(fn? %)))
m))
(defn- clob? [obj]
......@@ -31,7 +31,7 @@
(defn- -format-response [obj]
(cond
(map? obj) (->> (remove-fns-and-delays obj) ; recurse over all vals in the map
(map-vals -format-response))
(map-vals -format-response))
(coll? obj) (map -format-response obj) ; recurse over all items in the collection
(clob? obj) (util/jdbc-clob->str obj)
:else obj))
......@@ -143,8 +143,9 @@
(cond (sequential? response) (map auto-deserialize-dates response)
(map? response) (->> response
(map (fn [[k v]]
{k (if (contains? auto-deserialize-dates-keys k)
(deserialize-date v)
(auto-deserialize-dates v))}))
{k (cond
(contains? auto-deserialize-dates-keys k) (deserialize-date v)
(coll? v) (auto-deserialize-dates v)
:else v)}))
(into {}))
:else response))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment