mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-10 04:22:13 +10:00
fix: Move Authorization header generation to download_game_chunk()
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -274,7 +274,7 @@ impl GameDownloadAgent {
|
|||||||
("name", &context.file_name),
|
("name", &context.file_name),
|
||||||
("chunk", &context.index.to_string()),
|
("chunk", &context.index.to_string()),
|
||||||
],
|
],
|
||||||
|r| r.header("Authorization", generate_authorization_header()),
|
|r| { r },
|
||||||
) {
|
) {
|
||||||
Ok(request) => request,
|
Ok(request) => request,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
@ -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::download_manager::util::progress_object::ProgressHandle;
|
||||||
use crate::error::application_download_error::ApplicationDownloadError;
|
use crate::error::application_download_error::ApplicationDownloadError;
|
||||||
use crate::error::remote_access_error::RemoteAccessError;
|
use crate::error::remote_access_error::RemoteAccessError;
|
||||||
use crate::games::downloads::manifest::DropDownloadContext;
|
use crate::games::downloads::manifest::DropDownloadContext;
|
||||||
|
use crate::remote::auth::generate_authorization_header;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use md5::{Context, Digest};
|
use md5::{Context, Digest};
|
||||||
use reqwest::blocking::{RequestBuilder, Response};
|
use reqwest::blocking::{RequestBuilder, Response};
|
||||||
@ -124,6 +127,7 @@ pub fn download_game_chunk(
|
|||||||
progress.set(0);
|
progress.set(0);
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
request.header("Authorization", generate_authorization_header());
|
||||||
|
|
||||||
let response = request
|
let response = request
|
||||||
.send()
|
.send()
|
||||||
|
|||||||
Reference in New Issue
Block a user