We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44bbff1 commit 85b4dabCopy full SHA for 85b4dab
src/webserver/routing.rs
@@ -44,12 +44,14 @@ where
44
C: RoutingConfig,
45
{
46
if uri.path().starts_with(config.prefix().path()) {
47
- Ok(PathBuf::from(format!(
48
- "/{}",
+ let mut result = String::from("/");
+ result.push_str(
49
uri.path()
50
.strip_prefix(config.prefix().path())
51
- .expect("Unable to remove expected prefix from path")
52
- )))
+ .expect("Unable to remove expected prefix from path"),
+ );
53
+
54
+ Ok(PathBuf::from(result))
55
} else {
56
Err(Redirect(config.prefix().clone()))
57
}
0 commit comments