diff --git a/src/tools/http_request.rs b/src/tools/http_request.rs index fe1a48e..3e1c590 100644 --- a/src/tools/http_request.rs +++ b/src/tools/http_request.rs @@ -46,17 +46,19 @@ impl HttpRequestTool { if self.allowed_domains.is_empty() { anyhow::bail!( - "HTTP request tool is enabled but no allowed_domains are configured. Add [http_request].allowed_domains in config.toml" + "HTTP request tool is enabled but no allowed_domains are configured. Add [http_request].allowed_domains in config.toml or use [\"*\"] to allow all domains" ); } + let allow_all = self.allowed_domains.iter().any(|d| d == "*"); + let host = extract_host(url)?; if is_private_or_local_host(&host) { anyhow::bail!("Blocked local/private host: {host}"); } - if !host_matches_allowlist(&host, &self.allowed_domains) { + if !allow_all && !host_matches_allowlist(&host, &self.allowed_domains) { anyhow::bail!("Host '{host}' is not in http_request.allowed_domains"); }