aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/routes/ui/node.rs')
-rw-r--r--server/src/routes/ui/node.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs
index 989f655..4d599dc 100644
--- a/server/src/routes/ui/node.rs
+++ b/server/src/routes/ui/node.rs
@@ -1,10 +1,11 @@
/*
- This file is part of jellything (https://codeberg.org/metamuffin/jellything)
- which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
- Copyright (C) 2023 metamuffin <metamuffin.org>
+This file is part of jellything (https://codeberg.org/metamuffin/jellything)
+which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+Copyright (C) 2023 metamuffin <metamuffin.org>
*/
use super::error::MyError;
use super::player::player_uri;
+use super::CacheControlFile;
use crate::uri;
use crate::{
library::{Directory, Item, Library, Node},
@@ -148,7 +149,7 @@ pub async fn r_item_assets(
path: PathBuf,
role: AssetRole,
library: &State<Library>,
-) -> Result<(ContentType, File), MyError> {
+) -> Result<(ContentType, CacheControlFile), MyError> {
let node = library
.nested_path(&path)
.context("retrieving library node")?;
@@ -157,6 +158,6 @@ pub async fn r_item_assets(
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,
))
}