Strip slash instead

Also fix the only failing test
This commit is contained in:
Unknown 2018-10-28 18:22:41 +09:00
parent 2ba01028a0
commit 33582b4c1c
2 changed files with 4 additions and 4 deletions

View file

@ -33,8 +33,8 @@
(defn ensure-slash (defn ensure-slash
[^String string] [^String string]
(if (.endsWith string "/") (if (.endsWith string "/")
string (str/replace string #"/+$" "")
(str string "/"))) string))
(defn walk [raw-routes {:keys [path data routes expand] (defn walk [raw-routes {:keys [path data routes expand]
:or {data [], routes [], expand expand} :or {data [], routes [], expand expand}

View file

@ -230,8 +230,8 @@
true [["/a/1/2"] true [["/a/1/2"]
["/*b"]] ["/*b"]]
false [["/a"] true [["/a"]
["/a/"]] ["/a/"]]
false [["/a"] false [["/a"]
["/a/1"]] ["/a/1"]]