diff options
Diffstat (limited to 'server/src/routes/api/mod.rs')
-rw-r--r-- | server/src/routes/api/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/src/routes/api/mod.rs b/server/src/routes/api/mod.rs index fab60c6..af795f1 100644 --- a/server/src/routes/api/mod.rs +++ b/server/src/routes/api/mod.rs @@ -10,6 +10,7 @@ use std::path::PathBuf; use super::ui::{ account::{login_logic, LoginForm}, node::AssetRole, + CacheControlFile, }; use crate::{ database::Database, @@ -56,7 +57,7 @@ pub async fn r_api_assets_node( path: PathBuf, role: AssetRole, library: &State<Library>, -) -> ApiResult<(ContentType, File)> { +) -> ApiResult<(ContentType, CacheControlFile)> { let node = library .nested_path(&path) .context("retrieving library node")?; @@ -65,7 +66,7 @@ pub async fn r_api_assets_node( let ext = path.extension().unwrap().to_str().unwrap(); Ok(( ContentType::from_extension(ext).unwrap(), - File::open(path).await?, + CacheControlFile::new(File::open(path).await?).await, )) } |