diff --git a/modules/reitit-core/src/reitit/impl.cljc b/modules/reitit-core/src/reitit/impl.cljc index 58fb67e6..35a13737 100644 --- a/modules/reitit-core/src/reitit/impl.cljc +++ b/modules/reitit-core/src/reitit/impl.cljc @@ -163,7 +163,7 @@ (->> m (remove (comp nil? second)) (into {}))) ;; -;; Path-parameters, see https://github.com/metosin/reitit/issues/75 +;; Parts (c) https://github.com/lambdaisland/uri/tree/master/src/lambdaisland/uri ;; #?(:clj @@ -184,6 +184,10 @@ (defn percent-encode [^String unencoded] (->> (.getBytes unencoded "UTF-8") (map byte->percent) (str/join)))) +;; +;; encoding & decoding +;; + ;; + is safe, but removed so it would work the same as with js (defn url-encode [s] (if s diff --git a/test/cljc/reitit/impl_test.cljc b/test/cljc/reitit/impl_test.cljc index 1842d358..d7286d60 100644 --- a/test/cljc/reitit/impl_test.cljc +++ b/test/cljc/reitit/impl_test.cljc @@ -65,6 +65,8 @@ ;{:a (seq [1 2])} "a=1&a=2" ;{:a #{"c" "b"}} "a=b&a=c" +;; test from https://github.com/playframework/playframework -> UriEncodingSpec.scala + (deftest url-encode-test (are [in out] (= out (impl/url-encode in))