import { type RemotePattern } from '@astrojs/internal-helpers/remote';
/**
 * Parses a potentially comma-separated multi-value header (as produced by
 * proxy chains) and returns the first value, trimmed of whitespace.
 * Returns `undefined` when the header is absent or empty.
 */
export declare function getFirstForwardedValue(multiValueHeader: string | string[] | undefined): string | undefined;
type AllowedDomain = Partial<RemotePattern>;
/**
 * Validate a host against allowedDomains.
 * Returns the host only if it matches an allowed pattern; otherwise, undefined.
 * This prevents SSRF attacks by ensuring the Host header is trusted.
 */
export declare function validateHost(host: string | undefined, protocol: string, allowedDomains?: AllowedDomain[]): string | undefined;
/**
 * Validate forwarded headers (proto, host, port) against allowedDomains.
 *
 * Protocol, host and port are validated together against each entry, never one at a time:
 * - The forwarded host is accepted if an entry allows it with the forwarded protocol, or
 *   with `fallback.protocol` (the protocol the server would otherwise use).
 * - The forwarded protocol is accepted only if an entry for the host in use (the accepted
 *   forwarded host, or else `fallback.host`) allows it. If no entry matches that host, the
 *   forwarded protocol is not trusted.
 * - The forwarded port is accepted only if the entry for the host in use lists it.
 *
 * Returns the values to apply. Values that aren't returned must not be applied.
 *
 * @param fallback What the server would use without forwarded headers: the protocol of the
 *   connection or platform request, and the `Host` header or request URL host.
 */
export declare function validateForwardedHeaders(forwardedProtocol: string | undefined, forwardedHost: string | undefined, forwardedPort: string | undefined, allowedDomains: AllowedDomain[] | undefined, fallback: {
    protocol: string;
    host?: string;
}): {
    protocol?: string;
    host?: string;
    port?: string;
};
export {};
