pub struct FetchOptions {Show 14 fields
pub user_agent: Option<String>,
pub allow_prefixes: Vec<String>,
pub block_prefixes: Vec<String>,
pub enable_markdown: bool,
pub enable_text: bool,
pub dns_policy: DnsPolicy,
pub max_body_size: Option<usize>,
pub enable_save_to_file: bool,
pub respect_proxy_env: bool,
pub allowed_ports: Vec<u16>,
pub blocked_hosts: Vec<String>,
pub same_host_redirects_only: bool,
pub enable_render_rakers: bool,
pub transport: Option<Arc<dyn HttpTransport>>,
/* private fields */
}Expand description
Fetch options that can be configured via tool builder
Fields§
§user_agent: Option<String>Custom User-Agent
allow_prefixes: Vec<String>Allow list of URL prefixes
block_prefixes: Vec<String>Block list of URL prefixes
enable_markdown: boolEnable as_markdown option
enable_text: boolEnable as_text option
dns_policy: DnsPolicyDNS resolution policy for SSRF prevention
max_body_size: Option<usize>Maximum response body size in bytes (default: 10 MB) Protects against TM-DOS-001 (unbounded body) and TM-DOS-003 (gzip bombs)
enable_save_to_file: boolEnable save_to_file parameter in requests
respect_proxy_env: boolWhether to respect HTTP_PROXY/HTTPS_PROXY/NO_PROXY from the environment
allowed_ports: Vec<u16>Restrict outbound requests to these ports. Empty means any port.
blocked_hosts: Vec<String>Block exact hosts and suffix rules. Leading ‘.’ means suffix match.
same_host_redirects_only: boolRestrict redirects to the original host only.
enable_render_rakers: boolEnable rakers-rendered HTML fetching. The request must still opt in.
transport: Option<Arc<dyn HttpTransport>>Pluggable HTTP transport. When None, the default ReqwestTransport is used.
A host application can supply its own transport to route fetchkit’s outbound HTTP through a dedicated egress boundary. fetchkit still performs all URL validation, DNS policy resolution, redirect following, and content handling; only the socket-level send is delegated.
Trait Implementations§
Source§impl Clone for FetchOptions
impl Clone for FetchOptions
Source§fn clone(&self) -> FetchOptions
fn clone(&self) -> FetchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more