URL fetching (__qaFileUrl)
FetchFileUrlOptions
| Field | Description |
|---|---|
allowedHosts | Exact hostnames (case-insensitive). Entries starting with . match suffixes (e.g. .amazonaws.com). |
maxDownloadBytes | Hard cap on downloaded bytes. |
timeoutMs | Per-request timeout. |
maxRedirects | Optional redirect cap (default 3). |
allowHttp | When true, allows http: URLs (dev only; default false). |
isHostnameAllowed(hostname, allowedHosts)
Utility for preflight checks in custom gateways.
fetchFileUrl(urlString, options)
Performs an HTTPS GET (or HTTP when explicitly allowed), enforces hostname allowlist, size cap, timeout, and redirect rules. Returns { buffer, contentType, filename }.
Throws descriptive errors such as FILE_URL_FETCH_FAILED when the host is disallowed or limits are exceeded.
Bootstrap wiring
Pass the same options object (or a superset) to bootstrap / transports; only the public slice is copied onto catalog payloads via publicFileUrlCatalogSlice (see Uploads overview).