mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Fix #209
This commit is contained in:
parent
d30d1fdfaf
commit
b2cd7f37e2
4 changed files with 15 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 "")))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue