Struct git_transport::client::http::Options
source · pub struct Options {Show 15 fields
pub extra_headers: Vec<String>,
pub follow_redirects: FollowRedirects,
pub low_speed_limit_bytes_per_second: u32,
pub low_speed_time_seconds: u64,
pub proxy: Option<String>,
pub no_proxy: Option<String>,
pub proxy_auth_method: ProxyAuthMethod,
pub proxy_authenticate: Option<(Action, Arc<Mutex<AuthenticateFn>>)>,
pub user_agent: Option<String>,
pub connect_timeout: Option<Duration>,
pub verbose: bool,
pub ssl_ca_info: Option<PathBuf>,
pub ssl_version: Option<SslVersionRangeInclusive>,
pub http_version: Option<HttpVersion>,
pub backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>,
}
blocking-client
and http-client
only.Expand description
Options to configure http requests.
Fields§
§extra_headers: Vec<String>
Headers to be added to every request.
They are applied unconditionally and are expected to be valid as they occour in an HTTP request, like header: value
, without newlines.
Refers to http.extraHeader
multi-var.
follow_redirects: FollowRedirects
How to handle redirects.
Refers to http.followRedirects
.
low_speed_limit_bytes_per_second: u32
Used in conjunction with low_speed_time_seconds
, any non-0 value signals the amount of bytes per second at least to avoid
aborting the connection.
Refers to http.lowSpeedLimit
.
low_speed_time_seconds: u64
Used in conjunction with low_speed_bytes_per_second
, any non-0 value signals the amount seconds the minimal amount
of bytes per second isn’t reached.
Refers to http.lowSpeedTime
.
proxy: Option<String>
A curl-style proxy declaration of the form [protocol://][user[:password]@]proxyhost[:port]
.
Note that an empty string means the proxy is disabled entirely.
Refers to http.proxy
.
no_proxy: Option<String>
The comma-separated list of hosts to not send through the proxy
, or *
to entirely disable all proxying.
proxy_auth_method: ProxyAuthMethod
The way to authenticate against the proxy if the proxy
field contains a username.
Refers to http.proxyAuthMethod
.
proxy_authenticate: Option<(Action, Arc<Mutex<AuthenticateFn>>)>
If authentication is needed for the proxy as its URL contains a username, this method must be set to provide a password for it before making the request, and to store it if the connection succeeds.
user_agent: Option<String>
The HTTP
USER_AGENT
string presented to an HTTP
server, notably not the user agent present to the git
server.
If not overridden, it defaults to the user agent provided by curl
, which is a deviation from how git
handles this.
Thus it’s expected from the callers to set it to their application, or use higher-level crates which make it easy to do this
more correctly.
Using the correct user-agent might affect how the server treats the request.
Refers to http.userAgent
.
connect_timeout: Option<Duration>
The amount of time we wait until aborting a connection attempt.
If None
, this typically defaults to 2 minutes to 5 minutes.
Refers to gitoxide.http.connectTimeout
.
verbose: bool
If enabled, emit additional information about connections and possibly the data received or written.
ssl_ca_info: Option<PathBuf>
If set, use this path to point to a file with CA certificates to verify peers.
ssl_version: Option<SslVersionRangeInclusive>
The SSL version or version range to use, or None
to let the TLS backend determine which versions are acceptable.
http_version: Option<HttpVersion>
The HTTP version to enforce. If unset, it is implementation defined.
backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>
Backend specific options, if available.