mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-01 00:51:26 +00:00

and rename it to HttpOptions, since it's not specific to the "Simple" client at all. this is a breaking change. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
25 lines
617 B
Rust
25 lines
617 B
Rust
use crate::ProxyConfig;
|
|
|
|
/// Options for an HTTP client.
|
|
#[derive(Default)]
|
|
pub struct HttpOptions {
|
|
/// Proxy configuration
|
|
pub proxy_config: Option<ProxyConfig>,
|
|
/// `User-Agent` header value
|
|
pub user_agent: Option<String>,
|
|
/// TCP keepalive time, defaults to 7200
|
|
pub tcp_keepalive: Option<u32>,
|
|
}
|
|
|
|
impl HttpOptions {
|
|
pub fn get_proxy_authorization(&self) -> Option<String> {
|
|
if let Some(ref proxy_config) = self.proxy_config {
|
|
if !proxy_config.force_connect {
|
|
return proxy_config.authorization.clone();
|
|
}
|
|
}
|
|
|
|
None
|
|
}
|
|
}
|