diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index f08b7f826..21cae7d55 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -1061,7 +1061,7 @@ impl ClientBuilder { /// Set a `RedirectPolicy` for this client. /// /// Default will follow redirects up to a maximum of 10. - pub fn redirect(mut self, policy: redirect::Policy) -> ClientBuilder { + pub fn redirect_policy(mut self, policy: redirect::Policy) -> ClientBuilder { self.config.redirect_policy = policy; self } diff --git a/tests/redirect.rs b/tests/redirect.rs index 7c03678c6..20c7aeeb2 100644 --- a/tests/redirect.rs +++ b/tests/redirect.rs @@ -244,7 +244,7 @@ async fn test_redirect_policy_can_stop_redirects_without_an_error() { let url = format!("http://{}/no-redirect", server.addr()); let res = reqwest::Client::builder() - .redirect(reqwest::redirect::Policy::none()) + .redirect_policy(reqwest::redirect::Policy::none()) .build() .unwrap() .get(&url) @@ -377,7 +377,6 @@ async fn test_redirect_https_only_enforced_gh1312() { assert!(err.is_redirect()); } -// Code taken from: https://github.com/seanmonstar/reqwest/pull/1204 #[tokio::test] async fn test_request_redirect() { let code = 301u16; @@ -420,7 +419,7 @@ async fn test_request_redirect() { ); let no_redirect_client = reqwest::Client::builder() - .redirect(reqwest::redirect::Policy::none()) + .redirect_policy(reqwest::redirect::Policy::none()) .build() .unwrap();