Documentation
¶
Overview ¶
Package httpfetch provides an SSRF-safe HTTP client for fetching external URLs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fetch ¶
func Fetch(ctx context.Context, rawURL string, maxBytes int64) (body []byte, contentType string, err error)
Fetch downloads the resource at rawURL and returns its body and content-type. It enforces HTTPS-only, rejects private/loopback/link-local IPs to prevent SSRF, and limits the response body to maxBytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.