Don't view file when delete_on_download is set

Fixes #6
This commit is contained in:
neri 2021-04-04 14:36:38 +02:00
parent 313da6b583
commit e49800f05e
1 changed files with 1 additions and 1 deletions

View File

@ -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 {