From: Ian Jackson Date: Wed, 30 Mar 2022 20:59:25 +0000 (+0100) Subject: actix Files: Break out FILES_PATH X-Git-Tag: otter-1.0.0~76 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7149af6b93a81ea6255c8889e6f3dbac653af8fb;p=otter.git actix Files: Break out FILES_PATH Signed-off-by: Ian Jackson --- diff --git a/daemon/main.rs b/daemon/main.rs index e0389eba..31eb754d 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -374,6 +374,8 @@ async fn r_bundle(path: Path<( .set_content_type(ctype.into_mime()) } +const FILES_PATH: &'static str = "/_/src"; + #[derive(Error)] #[error("actix Files produced improper response: {0}")] #[derive(Debug, Clone, From)] @@ -509,7 +511,7 @@ async fn main() -> Result<(),StartupError> { .content_type(|ctype| ctype == mime::APPLICATION_JSON) .content_type_required(true); - let src_service = actix_files::Files::new("/_/src", &c.bundled_sources) + let src_service = actix_files::Files::new(FILES_PATH, &c.bundled_sources) .show_files_listing() .redirect_to_slash_directory() .index_file("index.html")