mirror of
https://github.com/metosin/reitit.git
synced 2026-02-15 15:55:15 +00:00
mention sources
This commit is contained in:
parent
ebecb7ee12
commit
7389838b59
2 changed files with 7 additions and 1 deletions
|
|
@ -163,7 +163,7 @@
|
||||||
(->> m (remove (comp nil? second)) (into {})))
|
(->> 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
|
#?(:clj
|
||||||
|
|
@ -184,6 +184,10 @@
|
||||||
(defn percent-encode [^String unencoded]
|
(defn percent-encode [^String unencoded]
|
||||||
(->> (.getBytes unencoded "UTF-8") (map byte->percent) (str/join))))
|
(->> (.getBytes unencoded "UTF-8") (map byte->percent) (str/join))))
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; encoding & decoding
|
||||||
|
;;
|
||||||
|
|
||||||
;; + is safe, but removed so it would work the same as with js
|
;; + is safe, but removed so it would work the same as with js
|
||||||
(defn url-encode [s]
|
(defn url-encode [s]
|
||||||
(if s
|
(if s
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,8 @@
|
||||||
;{:a (seq [1 2])} "a=1&a=2"
|
;{:a (seq [1 2])} "a=1&a=2"
|
||||||
;{:a #{"c" "b"}} "a=b&a=c"
|
;{:a #{"c" "b"}} "a=b&a=c"
|
||||||
|
|
||||||
|
;; test from https://github.com/playframework/playframework -> UriEncodingSpec.scala
|
||||||
|
|
||||||
(deftest url-encode-test
|
(deftest url-encode-test
|
||||||
(are [in out]
|
(are [in out]
|
||||||
(= out (impl/url-encode in))
|
(= out (impl/url-encode in))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue