aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-07 03:43:20 +0000
committerFuwn <[email protected]>2022-04-07 03:43:20 +0000
commit6e53a1d07bd6ce2f777627944bc1172c6611c124 (patch)
treef1797a4a25558c6d054d4bf36fb153da6744606c /src
parentdocs(cargo): bump version (diff)
downloadwindmark-6e53a1d07bd6ce2f777627944bc1172c6611c124.tar.xz
windmark-6e53a1d07bd6ce2f777627944bc1172c6611c124.zip
fix: try to fix path
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs11
1 files changed, 7 insertions, 4 deletions
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()
};