From e49800f05e3d303d90bf50929b30fc5816936779 Mon Sep 17 00:00:00 2001 From: neri Date: Sun, 4 Apr 2021 14:36:38 +0200 Subject: [PATCH] Don't view file when delete_on_download is set Fixes #6 --- src/download.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/download.rs b/src/download.rs index 4087617..0cdee50 100644 --- a/src/download.rs +++ b/src/download.rs @@ -41,7 +41,7 @@ pub async fn download( let mut path = config.files_dir.clone(); path.push(&file_id); - let download = req.query_string().contains("dl"); + let download = delete_on_download || req.query_string().contains("dl"); let (content_type, mut content_disposition) = get_content_types(&path, &file_name); let is_text = file_kind == FileKind::Text.to_string() || content_type.type_() == mime::TEXT; let response = if is_text && !download {