mirror of
https://github.com/metosin/reitit.git
synced 2026-02-01 10:20:35 +00:00
Strip slash instead
Also fix the only failing test
This commit is contained in:
parent
2ba01028a0
commit
33582b4c1c
2 changed files with 4 additions and 4 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
|
|
@ -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"]]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue