From bf42a51e8598f71932d58986be1a0fcef87b421a Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 23 Feb 2023 16:01:47 -0500 Subject: [PATCH] [F] Fix path joining --- backend/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index 36f0865..810cdfd 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -67,9 +67,9 @@ impl MyApp { } async fn hello_world(&self, req: Request) -> http::Result> { - 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();