diff --git a/src/fileserv.rs b/src/fileserv.rs index b9bebf8..4fe7a30 100644 --- a/src/fileserv.rs +++ b/src/fileserv.rs @@ -29,11 +29,11 @@ cfg_if! { if #[cfg(feature = "ssr")] { let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap(); // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot` // This path is relative to the cargo root - match ServeDir::new(root).oneshot(req).await { - Ok(res) => Ok(res.into_response()), - Err(err) => Err(( + match ServeDir::new(root).oneshot(req).await.ok() { + Some(res) => Ok(res.into_response()), + None => Err(( StatusCode::INTERNAL_SERVER_ERROR, - format!("Something went wrong: {err}"), + format!("Something went wrong"), )), } }