From 3f67edbc1ff22deca7094b7bb4b42ac353ce61fc Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Fri, 17 Feb 2023 10:40:28 -0500 Subject: [PATCH] [F] Fix path join --- backend/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index ada1f01..619d4fc 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -5,7 +5,7 @@ use std::convert::Infallible; use std::{env, fs}; use std::net::SocketAddr; use std::os::unix::fs::MetadataExt; -use hyper::{Body, http, Request, Response, Server, StatusCode}; +use hyper::{Body, http, Request, Response, Server}; use hyper::service::{make_service_fn, service_fn}; use serde::{Deserialize, Serialize}; use path_clean::{clean}; @@ -40,7 +40,7 @@ struct ReturnPath { } async fn hello_world(_req: Request) -> http::Result> { - let path = clean(_req.uri().path()); + let path = format!(".{}", clean(_req.uri().path())); println!("{path}"); // List files in directory