diff --git a/modules/reitit-core/src/reitit/trie.cljc b/modules/reitit-core/src/reitit/trie.cljc index 242ff299..acca35a7 100644 --- a/modules/reitit-core/src/reitit/trie.cljc +++ b/modules/reitit-core/src/reitit/trie.cljc @@ -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))))))) diff --git a/test/cljc/reitit/impl_test.cljc b/test/cljc/reitit/impl_test.cljc index 3c72ab23..bb9b24e8 100644 --- a/test/cljc/reitit/impl_test.cljc +++ b/test/cljc/reitit/impl_test.cljc @@ -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"))))