From 7389838b5953f774b424b8b31100619b5dd26d5a Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Wed, 1 Aug 2018 19:51:54 +0300 Subject: [PATCH] mention sources --- modules/reitit-core/src/reitit/impl.cljc | 6 +++++- test/cljc/reitit/impl_test.cljc | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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))