aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-27 14:50:24 +0000
committerFuwn <[email protected]>2025-05-27 14:50:24 +0000
commitb1aef25dddd59ec69f395d0e77fa3e4f2632f42c (patch)
tree8db52f6413cbea7a07d0fb7eadaa372d1c833e5f /src
parentfeat(router): Add set_listener_address (diff)
downloadwindmark-b1aef25dddd59ec69f395d0e77fa3e4f2632f42c.tar.xz
windmark-b1aef25dddd59ec69f395d0e77fa3e4f2632f42c.zip
fix(router): Compliant empty path handling
Diffstat (limited to 'src')
-rw-r--r--src/router.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/router.rs b/src/router.rs
index 40dac61..d999a32 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -413,14 +413,14 @@ impl Router {
}
}
+ if url.path().is_empty() {
+ url.set_path("/");
+ }
+
let fixed_path = if self.fix_path {
self
.routes
- .fix_path(if url.path().is_empty() {
- "/"
- } else {
- url.path()
- })
+ .fix_path(url.path())
.unwrap_or_else(|| url.path().to_string())
} else {
url.path().to_string()