Files
SnowLuma/.pnpm-store/v11/files/70/404d6bc07dfa67cef30996cf2915f3a0bf85b20a098f9bea811e2dc159496c07fcab676d611d6fe049bdc45352e06b805304b5300b49b55dea93c3a70352a9
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

45 lines
1.7 KiB
Plaintext

import { DehydratedMatch } from './types.cjs';
import { AnyRouter } from '../router.cjs';
import { AnyRouteMatch } from '../Matches.cjs';
import { Manifest, RouterManagedTag } from '../manifest.cjs';
declare module '../router' {
interface ServerSsr {
setRenderFinished: () => void;
cleanup: () => void;
}
interface RouterEvents {
onInjectedHtml: {
type: 'onInjectedHtml';
};
onSerializationFinished: {
type: 'onSerializationFinished';
};
}
}
export declare function dehydrateMatch(match: AnyRouteMatch): DehydratedMatch;
export declare function attachRouterServerSsrUtils({ router, manifest, getRequestAssets, includeUnmatchedRouteAssets, }: {
router: AnyRouter;
manifest: Manifest | undefined;
getRequestAssets?: () => Array<RouterManagedTag> | undefined;
includeUnmatchedRouteAssets?: boolean;
}): void;
/**
* Get the origin for the request.
*
* SECURITY: We intentionally do NOT trust the Origin header for determining
* the router's origin. The Origin header can be spoofed by attackers, which
* could lead to SSRF-like vulnerabilities where redirects are constructed
* using a malicious origin (CVE-2024-34351).
*
* Instead, we derive the origin from request.url, which is typically set by
* the server infrastructure (not client-controlled headers).
*
* For applications behind proxies that need to trust forwarded headers,
* use the router's `origin` option to explicitly configure a trusted origin.
*/
export declare function getOrigin(request: Request): string;
export declare function getNormalizedURL(url: string | URL, base?: string | URL): {
url: URL;
handledProtocolRelativeURL: boolean;
};