Skip to content

Commit

Permalink
Remove unescessary comment and normalize method name
Browse files Browse the repository at this point in the history
  • Loading branch information
mikayla-maki committed Oct 1, 2024
1 parent 8945f4a commit 6f88db0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 2 additions & 3 deletions tests/redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 6f88db0

Please sign in to comment.