mirror of
https://github.com/rustdesk/rustdesk
synced 2026-04-21 13:27:19 +00:00
fix reqwest proxy auth (#13354)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
055826e26f
commit
0f34c50bd2
2 changed files with 5 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 0e382020934f204a6a525a05c9b5ce9e96518025
|
||||
Subproject commit d6dd7ae052ac62f0f1538f1e056bce9429e28e33
|
||||
|
|
@ -36,19 +36,13 @@ macro_rules! configure_http_client {
|
|||
};
|
||||
|
||||
match proxy_setup {
|
||||
Ok(p) => {
|
||||
builder = builder.proxy(p);
|
||||
Ok(mut p) => {
|
||||
if let Some(auth) = proxy.intercept.maybe_auth() {
|
||||
let basic_auth =
|
||||
format!("Basic {}", auth.get_basic_authorization());
|
||||
if let Ok(auth) = basic_auth.parse() {
|
||||
builder = builder.default_headers(
|
||||
vec![(reqwest::header::PROXY_AUTHORIZATION, auth)]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
);
|
||||
if !auth.username().is_empty() && !auth.password().is_empty() {
|
||||
p = p.basic_auth(auth.username(), auth.password());
|
||||
}
|
||||
}
|
||||
builder = builder.proxy(p);
|
||||
builder.build().unwrap_or_else(|e| {
|
||||
info!("Failed to create a proxied client: {}", e);
|
||||
<$Client>::new()
|
||||
|
|
|
|||
Loading…
Reference in a new issue