aboutsummaryrefslogtreecommitdiff
path: root/src/api/core/mod.rs
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2024-07-12 17:51:19 +0200
committerDaniel García <[email protected]>2024-07-12 19:01:23 +0200
commitbbbbd2fb482684149b573aa1acbc98f7fb1408b9 (patch)
treee37ab37d386a76d6b3b5dc6429b8003d34c8c231 /src/api/core/mod.rs
parenta4ab014ade53e4e60bda0b9cbce3af9de7eac753 (diff)
downloadvaultwarden-bbbbd2fb482684149b573aa1acbc98f7fb1408b9.tar.gz
vaultwarden-bbbbd2fb482684149b573aa1acbc98f7fb1408b9.zip
Improved HTTP client
Diffstat (limited to 'src/api/core/mod.rs')
-rw-r--r--src/api/core/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs
index 9da0e886..41bd4d6b 100644
--- a/src/api/core/mod.rs
+++ b/src/api/core/mod.rs
@@ -12,6 +12,7 @@ pub use accounts::purge_auth_requests;
pub use ciphers::{purge_trashed_ciphers, CipherData, CipherSyncData, CipherSyncType};
pub use emergency_access::{emergency_notification_reminder_job, emergency_request_timeout_job};
pub use events::{event_cleanup_job, log_event, log_user_event};
+use reqwest::Method;
pub use sends::purge_sends;
pub fn routes() -> Vec<Route> {
@@ -53,7 +54,8 @@ use crate::{
auth::Headers,
db::DbConn,
error::Error,
- util::{get_reqwest_client, parse_experimental_client_feature_flags},
+ http_client::make_http_request,
+ util::parse_experimental_client_feature_flags,
};
#[derive(Debug, Serialize, Deserialize)]
@@ -139,9 +141,7 @@ async fn hibp_breach(username: &str) -> JsonResult {
);
if let Some(api_key) = crate::CONFIG.hibp_api_key() {
- let hibp_client = get_reqwest_client();
-
- let res = hibp_client.get(&url).header("hibp-api-key", api_key).send().await?;
+ let res = make_http_request(Method::GET, &url)?.header("hibp-api-key", api_key).send().await?;
// If we get a 404, return a 404, it means no breached accounts
if res.status() == 404 {