mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
fix reqwest proxy auth (#13354)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
Submodule libs/hbb_common updated: 0e38202093...d6dd7ae052
@@ -36,19 +36,13 @@ macro_rules! configure_http_client {
|
|||||||
};
|
};
|
||||||
|
|
||||||
match proxy_setup {
|
match proxy_setup {
|
||||||
Ok(p) => {
|
Ok(mut p) => {
|
||||||
builder = builder.proxy(p);
|
|
||||||
if let Some(auth) = proxy.intercept.maybe_auth() {
|
if let Some(auth) = proxy.intercept.maybe_auth() {
|
||||||
let basic_auth =
|
if !auth.username().is_empty() && !auth.password().is_empty() {
|
||||||
format!("Basic {}", auth.get_basic_authorization());
|
p = p.basic_auth(auth.username(), auth.password());
|
||||||
if let Ok(auth) = basic_auth.parse() {
|
|
||||||
builder = builder.default_headers(
|
|
||||||
vec![(reqwest::header::PROXY_AUTHORIZATION, auth)]
|
|
||||||
.into_iter()
|
|
||||||
.collect(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
builder = builder.proxy(p);
|
||||||
builder.build().unwrap_or_else(|e| {
|
builder.build().unwrap_or_else(|e| {
|
||||||
info!("Failed to create a proxied client: {}", e);
|
info!("Failed to create a proxied client: {}", e);
|
||||||
<$Client>::new()
|
<$Client>::new()
|
||||||
|
|||||||
Reference in New Issue
Block a user