parent
313da6b583
commit
e49800f05e
|
@ -41,7 +41,7 @@ pub async fn download(
|
||||||
let mut path = config.files_dir.clone();
|
let mut path = config.files_dir.clone();
|
||||||
path.push(&file_id);
|
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 (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 is_text = file_kind == FileKind::Text.to_string() || content_type.type_() == mime::TEXT;
|
||||||
let response = if is_text && !download {
|
let response = if is_text && !download {
|
||||||
|
|
Loading…
Reference in New Issue