aboutsummaryrefslogtreecommitdiff
path: root/src/api/core/mod.rs
diff options
context:
space:
mode:
authorDaniel GarcĂ­a <[email protected]>2024-07-12 22:33:11 +0200
committerGitHub <[email protected]>2024-07-12 22:33:11 +0200
commit035f694d2f94df5203bec6c0af951f78fcc888c2 (patch)
treec97b00c905735f11abae9ae621a93303288eca5a /src/api/core/mod.rs
parenta4ab014ade53e4e60bda0b9cbce3af9de7eac753 (diff)
downloadvaultwarden-035f694d2f94df5203bec6c0af951f78fcc888c2.tar.gz
vaultwarden-035f694d2f94df5203bec6c0af951f78fcc888c2.zip
Improved HTTP client (#4740)
* Improved HTTP client * Change config compat to use auto, rename blacklist * Fix wrong doc references
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 {