fix: Move Authorization header generation to download_game_chunk()

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-06-25 06:53:42 +10:00
parent 6d295bd47f
commit 885fa42ecc
2 changed files with 6 additions and 2 deletions

View File

@ -274,7 +274,7 @@ impl GameDownloadAgent {
("name", &context.file_name),
("chunk", &context.index.to_string()),
],
|r| r.header("Authorization", generate_authorization_header()),
|r| { r },
) {
Ok(request) => request,
Err(e) => {

View File

@ -1,8 +1,11 @@
use crate::download_manager::util::download_thread_control_flag::{DownloadThreadControl, DownloadThreadControlFlag};
use crate::download_manager::util::download_thread_control_flag::{
DownloadThreadControl, DownloadThreadControlFlag,
};
use crate::download_manager::util::progress_object::ProgressHandle;
use crate::error::application_download_error::ApplicationDownloadError;
use crate::error::remote_access_error::RemoteAccessError;
use crate::games::downloads::manifest::DropDownloadContext;
use crate::remote::auth::generate_authorization_header;
use log::warn;
use md5::{Context, Digest};
use reqwest::blocking::{RequestBuilder, Response};
@ -124,6 +127,7 @@ pub fn download_game_chunk(
progress.set(0);
return Ok(false);
}
request.header("Authorization", generate_authorization_header());
let response = request
.send()