aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-07-08 05:16:56 +0000
committerFuwn <[email protected]>2025-07-08 05:16:56 +0000
commit1381dfc93851550fe05d24d69401b1ba3af1add9 (patch)
treea8ea7ee0143adf8df771b8f49cb192f8bd808eb2 /src
parentfeat(router): Add missing trailing slash corrector (diff)
downloadwindmark-1381dfc93851550fe05d24d69401b1ba3af1add9.tar.xz
windmark-1381dfc93851550fe05d24d69401b1ba3af1add9.zip
refactor(RouterOption): Rename trailing slash trimming option
Diffstat (limited to 'src')
-rw-r--r--src/router.rs4
-rw-r--r--src/router_option.rs2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/router.rs b/src/router.rs
index 461d698..6ae33b0 100644
--- a/src/router.rs
+++ b/src/router.rs
@@ -424,7 +424,9 @@ impl Router {
let mut route = self.routes.at(&path);
if route.is_err() {
- if self.options.contains(&RouterOption::TrimTrailingSlashes)
+ if self
+ .options
+ .contains(&RouterOption::RemoveExtraTrailingSlash)
&& path.ends_with('/')
&& path != "/"
{
diff --git a/src/router_option.rs b/src/router_option.rs
index 2672a42..d3d0bb9 100644
--- a/src/router_option.rs
+++ b/src/router_option.rs
@@ -3,7 +3,7 @@
pub enum RouterOption {
/// Trim trailing slashes from the URL path if it is present and a route
/// match exists
- TrimTrailingSlashes,
+ RemoveExtraTrailingSlash,
/// Add a trailing slash to the URL path if it is missing and a route
/// match exists
AddMissingTrailingSlash,