Skip to content
Snippets Groups Projects
Commit da539efb authored by 🥺's avatar 🥺 :transgender_flag: Committed by 🥺
Browse files

only follow up to 6 redirects in default reqwest ClientBuilder

parent ae11e378
No related branches found
No related tags found
No related merge requests found
......@@ -539,10 +539,19 @@ pub fn shutdown(&self) {
}
fn reqwest_client_builder(config: &Config) -> Result<reqwest::ClientBuilder> {
let redirect_policy = reqwest::redirect::Policy::custom(|attempt| {
if attempt.previous().len() > 6 {
attempt.error("Too many redirects (max is 6)")
} else {
attempt.follow()
}
});
let mut reqwest_client_builder = reqwest::Client::builder()
.pool_max_idle_per_host(0)
.connect_timeout(Duration::from_secs(60))
.timeout(Duration::from_secs(60 * 5))
.redirect(redirect_policy)
.user_agent(concat!(
env!("CARGO_PKG_NAME"),
"/",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment