From c036deca6a0f6df2fa612f24138a61ba74a7ce6e Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 7 Apr 2022 03:43:20 +0000 Subject: fix: try to fix path --- src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index fcdd22b..f2a9269 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,15 +33,15 @@ //! # Cargo.toml //! //! [dependencies] -//! windmark = "0.1.10" +//! windmark = "0.1.11" //! tokio = { version = "0.2.4", features = ["full"] } //! //! # If you would like to use the built-in logger (recommended) -//! # windmark = { version = "0.1.10", features = ["logger"] } +//! # windmark = { version = "0.1.11", features = ["logger"] } //! //! # If you would like to use the built-in MIME dedection when `Success`-ing a file //! # (recommended) -//! # windmark = { version = "0.1.10", features = ["auto-deduce-mime"] } +//! # windmark = { version = "0.1.11", features = ["auto-deduce-mime"] } //! ``` //! //! ### Implement a Windmark server @@ -363,7 +363,10 @@ impl Router { } let fixed_path = if self.fix_path { - self.routes.fix_path(url.path()).unwrap() + self + .routes + .fix_path(url.path()) + .unwrap_or_else(|| url.path().to_string()) } else { url.path().to_string() }; -- cgit v1.2.3