Files
SnowLuma/.pnpm-store/v11/files/24/e49cfa595159bf5e8992d416b5b1efe528a467a27140a90bb7bf9ce3cd2549f9296b40810d2631a7af1f7039e2b392a2d4b8261f93a9dcf91d1fee24fa94b3
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

25 lines
1.2 KiB
Plaintext

/** Default upper bound, in bytes, on a request body read by the HTTP entry points (4 MiB). */
export declare const DEFAULT_MAX_REQUEST_BODY_SIZE: number;
/** Upper bound on the number of messages accepted in one JSON-RPC batch array. */
export declare const MAX_BATCH_SIZE = 100;
/** The message answered with 413 for a request body over `maxBytes`. */
export declare function requestBodyTooLargeMessage(maxBytes: number): string;
/**
* Resolves a `maxRequestBodySize` option to the bound to apply: the default when
* omitted, otherwise the value itself, which must be a positive finite number of
* bytes (a `RangeError` is thrown at configuration time for anything else).
*/
export declare function resolveMaxRequestBodySize(value: number | undefined): number;
/**
* Reads a request body as text, up to `maxBytes` (default
* {@linkcode DEFAULT_MAX_REQUEST_BODY_SIZE}). A declared `Content-Length` over the
* limit is refused without reading anything; otherwise the read stops as soon as
* more than the limit has arrived. Stream failures propagate.
*/
export declare function readRequestBody(request: Request, maxBytes?: number): Promise<{
tooLarge: true;
} | {
tooLarge: false;
text: string;
}>;
//# sourceMappingURL=requestBody.d.ts.map