This commit is contained in:
Tommi Reiman 2019-01-26 16:17:13 +02:00
parent d30d1fdfaf
commit b2cd7f37e2
4 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,7 @@
## 0.2.13 (2019-01-26)
* Don't throw `StringIndexOutOfBoundsException` with empty path lookup on wildcard paths, fixes [#209](https://github.com/metosin/reitit/issues/209)
## 0.2.12 (2019-01-18)
* fixed reflection & boxed math warnings, fixes [#207](https://github.com/metosin/reitit/issues/207)

View file

@ -19,7 +19,9 @@ public class SegmentTrie {
start = i + 1;
}
}
segments.add(path.substring(start, size));
if (start <= size) {
segments.add(path.substring(start, size));
}
return segments;
}

View file

@ -99,7 +99,8 @@
(is (= nil (matches "/items/")))
(is (= ::item (matches "/items/1")))
(is (= ::deep (matches "/items/1/2")))
(is (= nil (matches "/items//2"))))))
(is (= nil (matches "/items//2")))
(is (= nil (matches ""))))))
r/linear-router :linear-router
r/segment-router :segment-router

View file

@ -18,4 +18,9 @@
(-> (s/insert nil "/foo" {:a 1})
(s/insert "/foo/*bar" {:b 1})
(s/compile)
(s/lookup "/foo/bar")))))
(s/lookup "/foo/bar"))))
(is (= (s/->Match {:a 1} {})
(-> (s/insert nil "" {:a 1})
(s/compile)
(s/lookup "")))))