From 0cbb2657ab4663b9712473c991f1e84fea2bd077 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Mon, 19 Oct 2020 13:45:09 -0300 Subject: [PATCH] Deprecate functions for following redirects --- awc/src/builder.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/awc/src/builder.rs b/awc/src/builder.rs index 7cd659c38..41ff3a331 100644 --- a/awc/src/builder.rs +++ b/awc/src/builder.rs @@ -17,8 +17,6 @@ use crate::{Client, ClientConfig}; /// builder-like pattern. pub struct ClientBuilder { default_headers: bool, - allow_redirects: bool, - max_redirects: usize, max_http_version: Option, stream_window_size: Option, conn_window_size: Option, @@ -37,8 +35,6 @@ impl ClientBuilder { pub fn new() -> Self { ClientBuilder { default_headers: true, - allow_redirects: true, - max_redirects: 10, headers: HeaderMap::new(), timeout: Some(Duration::from_secs(5)), connector: None, @@ -77,9 +73,9 @@ impl ClientBuilder { /// Do not follow redirects. /// - /// Redirects are allowed by default. + /// Deprecated: this is a noop. Redirects aren't followed. + #[deprecated(since="2.0.1", note="this is a noop")] pub fn disable_redirects(mut self) -> Self { - self.allow_redirects = false; self } @@ -110,9 +106,9 @@ impl ClientBuilder { /// Set max number of redirects. /// - /// Max redirects is set to 10 by default. + /// Deprecated: this is a noop. Redirects aren' followed. + #[deprecated(since="2.0.1", note="this is a noop")] pub fn max_redirects(mut self, num: usize) -> Self { - self.max_redirects = num; self }