aboutsummaryrefslogtreecommitdiff
path: root/src/router.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-07-08 05:30:21 +0000
committerFuwn <[email protected]>2025-07-08 05:30:21 +0000
commit3e572d9f4092aad5dda01a7bc87c3c4377e289b1 (patch)
tree9523cccc017225cffdd599e930efb2e518eae285 /src/router.rs
parentdocs(router_option): Expand documentation (diff)
downloadwindmark-3e572d9f4092aad5dda01a7bc87c3c4377e289b1.tar.xz
windmark-3e572d9f4092aad5dda01a7bc87c3c4377e289b1.zip
feat(router): Add case-insensitive route matching option
Diffstat (limited to 'src/router.rs')
-rw-r--r--src/router.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/router.rs b/src/router.rs
index 6ae33b0..81eb6c4 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -421,6 +421,14 @@ impl Router {
}
let mut path = url.path().to_string();
+
+ if self
+ .options
+ .contains(&RouterOption::AllowCaseInsensitiveLookup)
+ {
+ path = path.to_lowercase();
+ }
+
let mut route = self.routes.at(&path);
if route.is_err() {