mirror of
https://github.com/metosin/reitit.git
synced 2026-02-08 04:43:12 +00:00
Empty colon-params are ignored
This commit is contained in:
parent
284d443e30
commit
998bf4a0d4
2 changed files with 10 additions and 1 deletions
|
|
@ -64,7 +64,9 @@
|
||||||
(recur (concat ss (-static from to) (-catch-all (inc to) to')) (inc to') (inc to'))
|
(recur (concat ss (-static from to) (-catch-all (inc to) to')) (inc to') (inc to'))
|
||||||
(recur (concat ss (-static from to) (-wild to to')) (inc to') (inc to'))))
|
(recur (concat ss (-static from to) (-wild to to')) (inc to') (inc to'))))
|
||||||
\: (let [to' (or (str/index-of s "/" to) (count s))]
|
\: (let [to' (or (str/index-of s "/" to) (count s))]
|
||||||
(recur (concat ss (-static from to) (-wild to to')) to' to'))
|
(if (= 1 (- to' to))
|
||||||
|
(recur ss from (inc to))
|
||||||
|
(recur (concat ss (-static from to) (-wild to to')) (long to') (long to'))))
|
||||||
\* (let [to' (count s)]
|
\* (let [to' (count s)]
|
||||||
(recur (concat ss (-static from to) (-catch-all to to')) to' to'))
|
(recur (concat ss (-static from to) (-catch-all to to')) to' to'))
|
||||||
(recur ss from (inc to)))))))
|
(recur ss from (inc to)))))))
|
||||||
|
|
|
||||||
|
|
@ -186,3 +186,10 @@
|
||||||
(= out (impl/form-decode in))
|
(= out (impl/form-decode in))
|
||||||
|
|
||||||
"%2B632+905+123+4567" "+632 905 123 4567"))
|
"%2B632+905+123+4567" "+632 905 123 4567"))
|
||||||
|
|
||||||
|
(deftest parse-test
|
||||||
|
(is (= (impl/map->Route
|
||||||
|
{:path "https://google.com"
|
||||||
|
:path-parts ["https://google.com"]
|
||||||
|
:path-params #{}})
|
||||||
|
(impl/parse "https://google.com"))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue