mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Fix based on Miikka’s comments
This commit is contained in:
parent
1c026569d9
commit
586b02f67d
1 changed files with 6 additions and 7 deletions
|
|
@ -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)))
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue