aboutsummaryrefslogtreecommitdiff
path: root/src/files.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/files.rs')
-rw-r--r--src/files.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/files.rs b/src/files.rs
index 68a3807..cf53942 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -21,7 +21,7 @@ use tokio::{
use tokio_util::io::poll_read_buf;
pub async fn serve_files(
- req: Request<Incoming>,
+ req: &Request<Incoming>,
config: &FileserverConfig,
) -> Result<hyper::Response<BoxBody<Bytes, ServiceError>>, ServiceError> {
let rpath = req.uri().path();
@@ -56,6 +56,7 @@ pub async fn serve_files(
if !config.index {
return Err(ServiceError::NotFound);
}
+ debug!("sending index for {path:?}");
if !rpath.ends_with("/") {
let mut r = Response::new(String::new());
@@ -78,6 +79,7 @@ pub async fn serve_files(
let range = req.headers().typed_get::<headers::Range>();
let range = bytes_range(range, metadata.len())?;
+ debug!("sending file {path:?}");
let file = File::open(path.clone()).await?;
let mut r = Response::new(BoxBody::new(StreamBody::new(