import { i as UpstreamFetchInit } from "./upstream-RyW4cAyx.js"; //#region src/core/security/public-url.d.ts interface PublicUrlPolicy { /** Allow plain `http:`. Default `false`: a payload sent over http can be read * and rewritten on the way. */ allowHttp?: boolean; /** * Hosts the URL must not target, on top of the built-in names. An entry * starting with `.` matches that domain and every subdomain. Pass your own * site's host: a webhook pointed back at the site is a request with the * site's standing. */ blockHosts?: readonly string[]; } interface FetchPublicUrlInit extends Omit, PublicUrlPolicy { /** Names the error. Default `"Remote"`. */ provider?: string; /** Redirect hops to follow, each checked against the policy. Default 3. */ maxRedirects?: number; } /** A URL the policy refuses—never retryable; the URL itself is the problem. */ declare class BlockedUrlError extends Error { /** Why, in a few words—for logs and for the person fixing the config. */ readonly reason: string; constructor(reason: string); } /** * Why `url` may not be fetched, or `null` when it may. The URL parser has * already normalized the tricks—`http://2130706433/` and `http://0x7f.1/` * both parse to `127.0.0.1`—so the checks run on what would actually be * requested. */ declare function publicUrlProblem(url: URL, policy?: PublicUrlPolicy): string | null; /** * {@link upstreamFetch} for a URL someone else chose: the same timeout and safe * error, plus {@link publicUrlProblem}'s policy on the URL and on every * redirect hop (at most `maxRedirects`, default 3). Throws * {@link BlockedUrlError} for a URL the policy refuses. * * Only a GET or HEAD follows any redirect. Anything else follows only a 307 or * 308, which keep the method and body: a 301/302/303 turns a POST into a GET * and drops the body, so a webhook would "succeed" with nothing delivered. * That 3xx is returned instead, as the non-ok response it is. A body followed * through a 307/308 is sent again, so pass a string or bytes, not a stream. */ declare function fetchPublicUrl(input: string | URL, init?: FetchPublicUrlInit): Promise; //#endregion export { publicUrlProblem as a, fetchPublicUrl as i, FetchPublicUrlInit as n, PublicUrlPolicy as r, BlockedUrlError as t };