Skip to content

Commit

Permalink
Rip out reqwest-middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Nov 22, 2024
1 parent f78713a commit 1a73695
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 42 deletions.
33 changes: 0 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ futures = "0.3"
tempfile = "3"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs", "process"] }
reqwest = { version = "0.12.8", default-features = false, features = ["blocking", "json", "rustls-tls", "rustls-tls-native-roots"] }
reqwest-middleware = { version = "0.4", features = ["rustls-tls"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = [
"ansi",
Expand Down
1 change: 0 additions & 1 deletion crates/criticalup-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ toml_edit = { version = "0.22.22", features = ["serde"] }
sha2 = { version = "0.10.8" }
dirs = { version = "5.0.1", default-features = false }
tokio.workspace = true
reqwest-middleware.workspace = true
tracing.workspace = true

[dev-dependencies]
Expand Down
9 changes: 4 additions & 5 deletions crates/criticalup-core/src/download_server_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use criticaltrust::manifests::ReleaseManifest;
use criticaltrust::manifests::{KeysManifest, ReleaseArtifactFormat};
use criticaltrust::signatures::Keychain;
use reqwest::header::{HeaderValue, AUTHORIZATION};
use reqwest::StatusCode;
use reqwest::Client;
use reqwest::{RequestBuilder, StatusCode};
use reqwest::{Response, Url};
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware, RequestBuilder};
use serde::Deserialize;

pub struct DownloadServerClient {
base_url: String,
client: ClientWithMiddleware,
client: Client,
state: State,
trust_root: PublicKey,
}
Expand All @@ -27,7 +27,6 @@ impl DownloadServerClient {
.user_agent(config.whitelabel.http_user_agent)
.build()
.expect("failed to configure http client");
let client = ClientBuilder::new(client).build();

DownloadServerClient {
base_url: config.whitelabel.download_server_url.clone(),
Expand Down Expand Up @@ -137,7 +136,7 @@ impl DownloadServerClient {
let response_result = self.client.execute(req).await;

let response = response_result.map_err(|e| Error::DownloadServerError {
kind: DownloadServerError::NetworkWithMiddleware(e),
kind: DownloadServerError::Network(e),
url,
})?;

Expand Down
2 changes: 0 additions & 2 deletions crates/criticalup-core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ pub enum DownloadServerError {
UnexpectedResponseData(#[source] serde_json::Error),
#[error("Failed to send the network request.")]
Network(#[source] reqwest::Error),
#[error("Failed to send the network request.")]
NetworkWithMiddleware(#[source] reqwest_middleware::Error),
}

#[derive(Debug, thiserror::Error)]
Expand Down

0 comments on commit 1a73695

Please sign in to comment.