Skip to content

Commit

Permalink
Empty colon-params are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Mar 1, 2019
1 parent 284d443 commit 998bf4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/reitit-core/src/reitit/trie.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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) (-wild to to')) (inc to') (inc to'))))
\: (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)]
(recur (concat ss (-static from to) (-catch-all to to')) to' to'))
(recur ss from (inc to)))))))
Expand Down
7 changes: 7 additions & 0 deletions test/cljc/reitit/impl_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,10 @@
(= out (impl/form-decode in))

"%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"))))

0 comments on commit 998bf4a

Please sign in to comment.