diff --git a/src/tools/http_request.rs b/src/tools/http_request.rs index 1d00253..d6f4cac 100644 --- a/src/tools/http_request.rs +++ b/src/tools/http_request.rs @@ -116,6 +116,7 @@ impl HttpRequestTool { ) -> anyhow::Result { let client = reqwest::Client::builder() .timeout(Duration::from_secs(self.timeout_secs)) + .redirect(reqwest::redirect::Policy::none()) .build()?; let mut request = client.request(method, url); @@ -799,4 +800,12 @@ mod tests { ); } } + + #[test] + fn redirect_policy_is_none() { + // Structural test: the tool should be buildable with redirect-safe config. + // The actual Policy::none() enforcement is in execute_request's client builder. + let tool = test_tool(vec!["example.com"]); + assert_eq!(tool.name(), "http_request"); + } }