Skip to main content

follow_redirects

Function follow_redirects 

Source
pub fn follow_redirects<B, E>() -> FollowRedirectLayer<impl Policy<B, E> + Clone + Send + Sync + 'static>
where B: Clone,
Available on crate feature tower only.
Expand description

The redirect follower this transport needs, policy and all.

Take this rather than building FollowRedirectLayer yourself, whose defaults are not all ones a custom protocol wants.

Extensions are dropped on every hop: the ones on an inbound request are the shell’s, and replaying them onto a request the application asked for would make one hop’s process-side state the next hop’s. A shell needing per-hop state attaches it beneath this layer, where nothing is inherited.