Fetches the content at url and returns its extracted, readable text.
Hardened against SSRF: only http/https URLs are fetched, the host is
resolved and rejected up front if it is localhost-style or resolves to a
private / loopback / link-local / shared / reserved / multicast address, and
redirects are never followed. Never throws for expected failures (bad scheme,
blocked host, non-200, timeout, network error); returns
Failed to fetch url: <url> instead.
Known limitation: global fetch performs its own DNS resolution at connect
time, so a residual time-of-check/time-of-use (DNS-rebinding) window exists
between this pre-flight lookup and fetch's own lookup. Full connection
IP-pinning (e.g. an undici Agent with a custom lookup) is a possible
future hardening.
Fetches the content at
urland returns its extracted, readable text.Hardened against SSRF: only
http/httpsURLs are fetched, the host is resolved and rejected up front if it islocalhost-style or resolves to a private / loopback / link-local / shared / reserved / multicast address, and redirects are never followed. Never throws for expected failures (bad scheme, blocked host, non-200, timeout, network error); returnsFailed to fetch url: <url>instead.Known limitation: global
fetchperforms its own DNS resolution at connect time, so a residual time-of-check/time-of-use (DNS-rebinding) window exists between this pre-flight lookup and fetch's own lookup. Full connection IP-pinning (e.g. anundiciAgent with a customlookup) is a possible future hardening.