diff --git a/tower-http/src/follow_redirect/policy/mod.rs b/tower-http/src/follow_redirect/policy/mod.rs index 8e5d39ce..2cff2bad 100644 --- a/tower-http/src/follow_redirect/policy/mod.rs +++ b/tower-http/src/follow_redirect/policy/mod.rs @@ -217,6 +217,15 @@ impl<'a> Attempt<'a> { pub fn previous(&self) -> &'a Uri { self.previous } + + /// Creates a new `Attempt`. + pub fn new(status: StatusCode, location: &'a Uri, previous: &'a Uri) -> Self { + Self { + status, + location, + previous, + } + } } /// A value returned by [`Policy::redirect`] which indicates the action