mirror of https://github.com/fafhrd91/actix-web
Deprecate functions for following redirects
This commit is contained in:
parent
e563025b16
commit
0cbb2657ab
|
@ -17,8 +17,6 @@ use crate::{Client, ClientConfig};
|
||||||
/// builder-like pattern.
|
/// builder-like pattern.
|
||||||
pub struct ClientBuilder {
|
pub struct ClientBuilder {
|
||||||
default_headers: bool,
|
default_headers: bool,
|
||||||
allow_redirects: bool,
|
|
||||||
max_redirects: usize,
|
|
||||||
max_http_version: Option<http::Version>,
|
max_http_version: Option<http::Version>,
|
||||||
stream_window_size: Option<u32>,
|
stream_window_size: Option<u32>,
|
||||||
conn_window_size: Option<u32>,
|
conn_window_size: Option<u32>,
|
||||||
|
@ -37,8 +35,6 @@ impl ClientBuilder {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
ClientBuilder {
|
ClientBuilder {
|
||||||
default_headers: true,
|
default_headers: true,
|
||||||
allow_redirects: true,
|
|
||||||
max_redirects: 10,
|
|
||||||
headers: HeaderMap::new(),
|
headers: HeaderMap::new(),
|
||||||
timeout: Some(Duration::from_secs(5)),
|
timeout: Some(Duration::from_secs(5)),
|
||||||
connector: None,
|
connector: None,
|
||||||
|
@ -77,9 +73,9 @@ impl ClientBuilder {
|
||||||
|
|
||||||
/// Do not follow redirects.
|
/// 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 {
|
pub fn disable_redirects(mut self) -> Self {
|
||||||
self.allow_redirects = false;
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,9 +106,9 @@ impl ClientBuilder {
|
||||||
|
|
||||||
/// Set max number of redirects.
|
/// 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 {
|
pub fn max_redirects(mut self, num: usize) -> Self {
|
||||||
self.max_redirects = num;
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue