expression

Disable automatic redirects for review

An explicit no-redirect policy lets the application decide whether to follow a Location response. HTTPS-only and no-proxy are additional controls, not a complete destination or SSRF policy. This fixture does not test enforcement over a connection. External crate example; constructs requests or synthetic responses in memory; no request is sent. Expected stdout (not executed): https Common mistake: Assuming HTTPS alone makes arbitrary user-controlled destinations safe.

Formal Syntax & Structure

rust syntaxrust
ClientBuilder::redirect(Policy::none())

Working Example

Example Snippetrust
#[tokio::main(flavor = "current_thread")]async fn main() {    let c = reqwest::Client::builder().no_proxy().https_only(true).redirect(reqwest::redirect::Policy::none()).build().unwrap();    let r = c.get("https://example.com/books").build().unwrap();    println!("{}", r.url().scheme());}
Rust Reference