mirror of
https://github.com/modrinth/code.git
synced 2026-09-02 04:56:52 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user