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.
2 parents 7a78ebe + 4d94352 commit 702e514Copy full SHA for 702e514
src/fs/serve_dir.rs
@@ -25,7 +25,7 @@ where
25
{
26
async fn call(&self, req: Request<State>) -> Result {
27
let path = req.url().path();
28
- let path = path.trim_start_matches(&self.prefix);
+ let path = path.strip_prefix(&self.prefix).unwrap();
29
let path = path.trim_start_matches('/');
30
let mut file_path = self.dir.clone();
31
for p in Path::new(path) {
0 commit comments