Skip to main content

Module fetch

Module fetch 

Source
Expand description

Bounded, SSRF-aware HTTP fetch built on ureq.

Redirects are followed manually so every hop passes back through url_guard, closing the redirect-to-internal SSRF hole that automatic redirect following would open. Response bodies are capped to a byte budget so a hostile server cannot exhaust memory.

Structs§

FetchedDoc
A fetched document with its raw body bytes and resolved metadata.

Constants§

DEFAULT_MAX_BYTES
Default response body cap (4 MiB) — generous for articles, safe for memory.
DEFAULT_TIMEOUT_SECS
Default total request timeout in seconds.

Functions§

fetch
Fetch url, following up to MAX_REDIRECTS re-validated redirects.
post
POST body to url (SSRF-guarded, bounded, redirects not followed).