aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-07 03:58:20 +0000
committerFuwn <[email protected]>2022-04-07 03:58:20 +0000
commitb9ec54b81abb193b2fc19d24ceec25d603ca2431 (patch)
tree40ee65c8eda206fcce6654321c34f0aa0527a4a1 /src/lib.rs
parentfix: try to fix path (diff)
downloadwindmark-b9ec54b81abb193b2fc19d24ceec25d603ca2431.tar.xz
windmark-b9ec54b81abb193b2fc19d24ceec25d603ca2431.zip
fix: trailing for fix
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f2a9269..7400331 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -365,7 +365,11 @@ impl Router {
let fixed_path = if self.fix_path {
self
.routes
- .fix_path(url.path())
+ .fix_path(if url.path().is_empty() {
+ "/"
+ } else {
+ url.path()
+ })
.unwrap_or_else(|| url.path().to_string())
} else {
url.path().to_string()