Fix based on Miikka’s comments

This commit is contained in:
Tommi Reiman 2018-03-22 18:57:53 +02:00
parent 1c026569d9
commit 586b02f67d

View file

@ -166,7 +166,7 @@
(some-> s (some-> s
#?(:clj (URLEncoder/encode "UTF-8") #?(:clj (URLEncoder/encode "UTF-8")
:cljs (js/encodeURIComponent)) :cljs (js/encodeURIComponent))
(.replace "+" "%20"))) #?(:clj (.replace "+" "%20"))))
(defn url-decode [s] (defn url-decode [s]
(some-> s #?(:clj (URLDecoder/decode "UTF-8") (some-> s #?(:clj (URLDecoder/decode "UTF-8")
@ -201,9 +201,8 @@
(defn path-params (defn path-params
"shallow transform of the path-param values into strings" "shallow transform of the path-param values into strings"
[params] [params]
(persistent! (reduce-kv
(reduce-kv (fn [m k v]
(fn [m k v] (assoc m k (url-encode (into-string v))))
(assoc! m k (url-encode (into-string v)))) {}
(transient {}) params))
params)))