fix(app-lib): remove timeout for shared instance uploads (#7304)

* fix(app-lib): remove timeout for shared instance uploads

* style(app-lib): cargo fmt

* style(app-lib): remove unused import
This commit is contained in:
Sychic
2026-08-25 18:28:47 +00:00
committed by GitHub
parent e33ef5f252
commit 7420560784
3 changed files with 43 additions and 12 deletions
@@ -874,7 +874,7 @@ pub(super) async fn send_bytes_request_to_url(
"Sending shared instances API request"
);
let mut request = shared_instances_client(url)
let mut request = shared_instances_upload_client(url)
.request(method.clone(), url)
.bearer_auth(credentials.session)
.header(reqwest::header::CONTENT_TYPE, "application/octet-stream")
@@ -1063,3 +1063,13 @@ pub(super) fn shared_instances_client(
&INSECURE_REQWEST_CLIENT
}
}
pub(super) fn shared_instances_upload_client(
base_url: &str,
) -> &'static reqwest::Client {
if base_url.starts_with("https://") {
&NO_TIMEOUT_REQWEST_CLIENT
} else {
&INSECURE_NO_TIMEOUT_REQWEST_CLIENT
}
}
@@ -15,7 +15,10 @@ use crate::state::{
ContentSourceKind, EditInstance, ModLoader, ModrinthCredentials,
ProjectType, SharedInstanceRole, State,
};
use crate::util::fetch::{INSECURE_REQWEST_CLIENT, REQWEST_CLIENT};
use crate::util::fetch::{
INSECURE_NO_TIMEOUT_REQWEST_CLIENT, INSECURE_REQWEST_CLIENT,
NO_TIMEOUT_REQWEST_CLIENT, REQWEST_CLIENT,
};
use chrono::{DateTime, Utc};
use reqwest::{Method, StatusCode};
use serde::de::DeserializeOwned;