diff options
| author | Fuwn <[email protected]> | 2025-07-08 05:30:21 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-08 05:30:21 +0000 |
| commit | 3e572d9f4092aad5dda01a7bc87c3c4377e289b1 (patch) | |
| tree | 9523cccc017225cffdd599e930efb2e518eae285 /src/router.rs | |
| parent | docs(router_option): Expand documentation (diff) | |
| download | windmark-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.rs | 8 |
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() { |