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 | 6544d0dc7762b3ddf5d59db68629f2bd4a55650f (patch) | |
| tree | 9523cccc017225cffdd599e930efb2e518eae285 /src/router.rs | |
| parent | docs(router_option): Expand documentation (diff) | |
| download | windmark-6544d0dc7762b3ddf5d59db68629f2bd4a55650f.tar.xz windmark-6544d0dc7762b3ddf5d59db68629f2bd4a55650f.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() { |