Skip to content

Commit 998967f

Browse files
authored
chore: upgrade reqwest to 0.12 and remove direct deb of http (#159)
1 parent b921140 commit 998967f

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ license = "Apache-2.0"
88

99
[dependencies]
1010
base64 = "0.22.1"
11-
http = "0.2"
12-
reqwest = { version = "0.11", default-features = false, features = ["json", "default-tls"] }
11+
reqwest = { version = "0.12", default-features = false, features = ["json", "default-tls"] }
1312
serde = { version = "1.0.152", features = ["serde_derive"] }
1413
serde_json = "1.0"
1514
thiserror = "1.0.38"

src/beam.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::time::Duration;
22

33
use beam_lib::{TaskResult, BeamClient, BlockingOptions, MsgId, TaskRequest, RawString};
4-
use http::StatusCode;
4+
use reqwest::StatusCode;
55
use once_cell::sync::Lazy;
66
use serde::Serialize;
77
use tracing::{debug, warn, info};

src/blaze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use http::StatusCode;
1+
use reqwest::StatusCode;
22
use serde::Deserialize;
33
use serde::Serialize;
44
use serde_json::Value;

src/config.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33

44
use beam_lib::AppId;
55
use clap::Parser;
6-
use http::{HeaderValue, Uri};
6+
use reqwest::{header::HeaderValue, Url};
77
use once_cell::sync::Lazy;
88
use reqwest::{Certificate, Client, Proxy};
99
use tracing::{debug, info, warn};
@@ -55,7 +55,7 @@ const CLAP_FOOTER: &str = "For proxy support, environment variables HTTP_PROXY,
5555
struct CliArgs {
5656
/// The beam proxy's base URL, e.g. https://proxy1.beam.samply.de
5757
#[clap(long, env, value_parser)]
58-
beam_proxy_url: Uri,
58+
beam_proxy_url: Url,
5959

6060
/// This application's beam AppId, e.g. focus.proxy1.broker.samply.de
6161
#[clap(long, env, value_parser)]
@@ -71,15 +71,15 @@ struct CliArgs {
7171

7272
/// The endpoint base URL, e.g. https://blaze.site/fhir/
7373
#[clap(long, env, value_parser)]
74-
endpoint_url: Option<Uri>,
74+
endpoint_url: Option<Url>,
7575

7676
/// The endpoint base URL, e.g. https://blaze.site/fhir/, for the sake of backward compatibility, use endpoint_url instead
7777
#[clap(long, env, value_parser)]
78-
blaze_url: Option<Uri>,
78+
blaze_url: Option<Url>,
7979

8080
/// The exporter URL, e.g. https://exporter.site/
8181
#[clap(long, env, value_parser)]
82-
exporter_url: Option<Uri>,
82+
exporter_url: Option<Url>,
8383

8484
/// Type of the endpoint, e.g. "blaze", "omop"
8585
#[clap(long, env, value_parser = clap::value_parser!(EndpointType), default_value = "blaze")]
@@ -164,12 +164,12 @@ struct CliArgs {
164164
}
165165

166166
pub(crate) struct Config {
167-
pub beam_proxy_url: Uri,
167+
pub beam_proxy_url: Url,
168168
pub beam_app_id_long: AppId,
169169
pub api_key: String,
170170
pub retry_count: usize,
171-
pub endpoint_url: Uri,
172-
pub exporter_url: Option<Uri>,
171+
pub endpoint_url: Url,
172+
pub exporter_url: Option<Url>,
173173
pub endpoint_type: EndpointType,
174174
pub obfuscate: Obfuscate,
175175
pub obfuscate_zero: bool,

src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use reqwest::header;
12
use thiserror::Error;
23

34
#[derive(Error, Debug)]
@@ -55,7 +56,7 @@ pub enum FocusError {
5556
#[error("Invalid date format: {0}")]
5657
AstInvalidDateFormat(String),
5758
#[error("Invalid Header Value: {0}")]
58-
InvalidHeaderValue(http::header::InvalidHeaderValue),
59+
InvalidHeaderValue(header::InvalidHeaderValue),
5960
#[error("Missing Exporter Endpoint")]
6061
MissingExporterEndpoint,
6162
#[error("Missing Exporter Task Type")]

src/exporter.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use http::header;
2-
use http::HeaderMap;
3-
use http::HeaderValue;
4-
use http::StatusCode;
1+
use reqwest::{header::{self, HeaderMap, HeaderValue}, StatusCode};
52
use serde::Deserialize;
63
use serde::Serialize;
74
use serde_json::Value;

src/intermediate_rep.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use http::header;
2-
use http::HeaderMap;
3-
use http::HeaderValue;
4-
use http::StatusCode;
1+
use reqwest::{header::{self, HeaderMap, HeaderValue}, StatusCode};
52
use serde::Deserialize;
63
use serde::Serialize;
74
use tracing::{debug, warn};

0 commit comments

Comments
 (0)