clear unwrap (#8605)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-07-04 20:18:53 +08:00
committed by GitHub
parent 94addb162b
commit 86ff768241
11 changed files with 54 additions and 42 deletions

View File

@@ -24,14 +24,16 @@ macro_rules! configure_http_client {
if let Some(auth) = proxy.intercept.maybe_auth() {
let basic_auth =
format!("Basic {}", auth.get_basic_authorization());
builder = builder.default_headers(
vec![(
reqwest::header::PROXY_AUTHORIZATION,
basic_auth.parse().unwrap(),
)]
.into_iter()
.collect(),
);
if let Ok(auth) = basic_auth.parse() {
builder = builder.default_headers(
vec![(
reqwest::header::PROXY_AUTHORIZATION,
auth,
)]
.into_iter()
.collect(),
);
}
}
builder.build().unwrap_or_else(|e| {
info!("Failed to create a proxied client: {}", e);