From b1aef25dddd59ec69f395d0e77fa3e4f2632f42c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 27 May 2025 14:50:24 +0000 Subject: fix(router): Compliant empty path handling --- src/router.rs | 10 +++++----- 1 file 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() -- cgit v1.2.3