Merge pull request #45 from ViViDboarder/dependabot/cargo/reqwest-0.11.4

This commit is contained in:
dependabot[bot] 2021-12-11 01:49:36 +00:00 committed by GitHub
commit f1b229ebc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 278 additions and 949 deletions

1218
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ edition = "2018"
ldap3 = "0.9" ldap3 = "0.9"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
toml = "0.5" toml = "0.5"
reqwest = "0.9" reqwest = { version = "0.11", features = ["json", "blocking"] }
serde_json = "1.0" serde_json = "1.0"
thiserror = "1.0" thiserror = "1.0"
anyhow = "1.0" anyhow = "1.0"

View File

@ -2,7 +2,7 @@ extern crate reqwest;
extern crate serde; extern crate serde;
extern crate thiserror; extern crate thiserror;
use reqwest::Response; use reqwest::blocking::Response;
use serde::Deserialize; use serde::Deserialize;
use std::collections::HashMap; use std::collections::HashMap;
use std::fs::File; use std::fs::File;
@ -72,8 +72,9 @@ impl Client {
reqwest::Certificate::from_der(&buf).expect("Could not load DER root cert file") reqwest::Certificate::from_der(&buf).expect("Could not load DER root cert file")
} }
fn get_http_client(&self) -> reqwest::Client { fn get_http_client(&self) -> reqwest::blocking::Client {
let mut client = reqwest::Client::builder().redirect(reqwest::RedirectPolicy::none()); let mut client =
reqwest::blocking::Client::builder().redirect(reqwest::redirect::Policy::none());
if !&self.root_cert_file.is_empty() { if !&self.root_cert_file.is_empty() {
let cert = self.get_root_cert(); let cert = self.get_root_cert();