[F] Fix path joining

This commit is contained in:
Azalea Gui
2023-02-23 16:01:47 -05:00
parent df64020e07
commit bf42a51e85
+3 -3
View File
@@ -67,9 +67,9 @@ impl MyApp {
}
async fn hello_world(&self, req: Request<Body>) -> http::Result<Response<Body>> {
let mut path: String = url_escape::decode(req.uri().path()).into_owned();
path = format!(".{}", clean(&*path));
println!("Raw path: {} | Sanitized path: {path}", req.uri().path());
let rel: String = clean(&url_escape::decode(req.uri().path()));
let path = self.generator.base.join(&rel.strip_prefix("/").unwrap());
println!("Raw path: {} | Sanitized path: {}", req.uri().path(), path.display());
let params = req.params();