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
[^String string]
(if (.endsWith string "/")
string
(str string "/")))
(str/replace string #"/+$" "")
string))
(defn walk [raw-routes {:keys [path data routes expand]
:or {data [], routes [], expand expand}

View file

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