mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2026-03-03 15:10:50 +01:00
Add Content-Length header
This commit is contained in:
@@ -40,6 +40,7 @@ pub async fn download(
|
||||
|
||||
let filename = data.filename.clone();
|
||||
let filename_ascii = data.filename_ascii.clone();
|
||||
let file_size = data.data_size;
|
||||
|
||||
let reader = data.get_async_read();
|
||||
let stream = ReaderStream::new(reader);
|
||||
@@ -52,6 +53,10 @@ pub async fn download(
|
||||
header::CONTENT_DISPOSITION,
|
||||
format!("attachment; filename={filename_ascii}"),
|
||||
),
|
||||
(
|
||||
header::CONTENT_LENGTH,
|
||||
format!("{file_size}")
|
||||
),
|
||||
(
|
||||
header::HeaderName::from_static("x-filename-b64"),
|
||||
encoder.encode(filename),
|
||||
|
||||
Reference in New Issue
Block a user