diff options
| author | Fuwn <[email protected]> | 2025-05-27 14:50:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-05-27 14:50:24 +0000 |
| commit | b1aef25dddd59ec69f395d0e77fa3e4f2632f42c (patch) | |
| tree | 8db52f6413cbea7a07d0fb7eadaa372d1c833e5f | |
| parent | feat(router): Add set_listener_address (diff) | |
| download | windmark-b1aef25dddd59ec69f395d0e77fa3e4f2632f42c.tar.xz windmark-b1aef25dddd59ec69f395d0e77fa3e4f2632f42c.zip | |
fix(router): Compliant empty path handling
| -rw-r--r-- | src/router.rs | 10 |
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() |