fix: apply timeout to everything

This commit is contained in:
əlemi 2024-10-25 21:10:49 +02:00
parent 9c26b68806
commit 447b073110

View file

@ -85,6 +85,8 @@ impl EndpointConfig {
let client = reqwest::Client::builder()
.user_agent(opts.user_agent.as_deref().unwrap_or(APP_USER_AGENT))
.timeout(std::time::Duration::from_secs(opts.timeout.unwrap_or(30)))
.read_timeout(std::time::Duration::from_secs(opts.timeout.unwrap_or(30)))
.connect_timeout(std::time::Duration::from_secs(opts.timeout.unwrap_or(30)))
.redirect(opts.redirects.map(reqwest::redirect::Policy::limited).unwrap_or(reqwest::redirect::Policy::none()))
.danger_accept_invalid_certs(opts.accept_invalid_certs.unwrap_or(false))
.build()?;